Re: [R] Problem with minimization that I failed to understand

2025-03-28 Thread Daniel Lobo
2.05/100 I can see that the constraint #2 is implemented in the function argument lower = rep(0.01, 21), How can I impose other 2 constraints? Many thanks, On Sat, 29 Mar 2025 at 01:49, Rui Barradas wrote: > Às 13:59 de 28/03/2025, Daniel Lobo escreveu: > > Hi Duncan, > > >

Re: [R] Problem with minimization that I failed to understand

2025-03-28 Thread Daniel Lobo
don't know if there is an R function that can do > constrained discrete maximization. > > Duncan Murdoch > > On 2025-03-27 2:35 p.m., Daniel Lobo wrote: > > Hi, > > > > I have below minimization problem > > > > > > MyDat = structure(list(c(50L, 0L,

Re: [R] Problem with minimization that I failed to understand

2025-03-27 Thread Daniel Lobo
, 28 Mar 2025 at 03:53, Rui Barradas wrote: > Às 19:36 de 27/03/2025, Daniel Lobo escreveu: > > My code is to minimize the objective function > > > > therefore, shouldnt I expect that > > > > StartingValue = c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09,

Re: [R] Problem with minimization that I failed to understand

2025-03-27 Thread Daniel Lobo
6, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02)) #FALSE On Fri, 28 Mar 2025 at 00:58, Rui Barradas wrote: > Às 18:35 de 27/03/2025, Daniel Lobo escreveu: > > Hi, > > > > I have below minimization problem > > > > > > MyDat = structure(list(c(50L, 0L, 0L, 50L, 7

[R] Problem with minimization that I failed to understand

2025-03-27 Thread Daniel Lobo
Hi, I have below minimization problem MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L, 25L, 50L, 50L, 75L, 75L, 75L, 0L, 75L, 75L, 75L, 0L, 25L, 75L, 75L, 0L, 75L, 100L, 0L, 25L, 100L), c(75L, 0L, 0L, 50L, 100L, 50L, 75L, 75L, 100L, 25L, 0L, 25L, 100L, 0L, 50L, 0L, 25L, 25

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Daniel Nordlund
commented, minimal, self-contained, reproducible code. -- Daniel Nordlund Port Townsend, WA (425) 273-5256 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

[R] Details about the boxcox function

2025-01-23 Thread Daniel Lobo
Hi, I tried with library(MASS) methods('boxcox') # [1] boxcox.default* boxcox.formula* boxcox.lm* Then > boxcox.lm Error: object 'boxcox.lm' not found How to look into the codes of boxcox.lm? Thanks for your time [[alternative HTML version deleted]]

[R] Calculation of critical probability from lm()

2024-12-23 Thread Daniel Lobo
Hi, I tried to replicate the values of critical probabilities reported from lm() function in R as below ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) model_c

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
early indicates that it is quitting without reaching an > optimum, but you are hiding that message. Don't do that. > > Duncan Murdoch > > On 2024-12-13 12:52 p.m., Daniel Lobo wrote: > > library(nloptr) > > > > set.seed(1) > > A <- 1.34 > > B <-

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
Looks like the solution 1.576708 6.456606 6.195305 -19.007996 is the best solution that nloptr can produce by increasing the iteration numbers. The better set of solution is obtained using pracma package. On Sat, 14 Dec 2024 at 01:14, John Fox wrote: > > Dear Daniel et al., > >

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
ntraint are computed correctly? > > 50% of "your software doesn't work" in optimization are due to such errors. > > John Nash > > > On 2024-12-13 12:52, Daniel Lobo wrote: > > Hi, > > > > I have below non-linear constraint optimization problem >

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
Adding R help On Fri, 13 Dec 2024 at 23:39, Daniel Lobo wrote: > > If I use "algorithm" = "BOBYQA", the nloptr() fails with below message > > Error in is.nloptr(ret) : > > Incorrect algorithm supplied. Use one of the following: >

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
A small correction, the below combination 2.02, 6.764, 6.186, -20.095 Gives better result. On Fri, 13 Dec 2024 at 23:22, Daniel Lobo wrote: > > Hi, > > I have below non-linear constraint optimization problem > > #Original artificial data > > library(nloptr) > &g

[R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Daniel Lobo
Hi, I have below non-linear constraint optimization problem #Original artificial data library(nloptr) set.seed(1) A <- 1.34 B <- 0.5673 C <- 6.356 D <- -1.234 x <- seq(0.5, 20, length.out = 500) y <- A + B * x + C * x^2 + D * log(x) + runif(500, 0, 3) #Objective function X <- cbind(1, x, x^2,

[R] Calculation of VCV matrix of estimated coefficient

2024-09-04 Thread Daniel Lobo
Hi, I am trying to replicate the R's result for VCV matrix of estimated coefficients from linear model as below data(mtcars) model <- lm(mpg~disp+hp, data=mtcars) model_summ <-summary(model) MSE = mean(model_summ$residuals^2) vcov(model) Now I want to calculate the same thing manually, library(

[R] summaryRprof: Unexpected unit for memory profiling

2024-07-01 Thread Sauer, Lukas Daniel
Hello, I am profiling memory usage using utils::Rprof() and subsequently summarizing the profile using utils::summaryRprof(). According to the documentation ?summaryRprof, the option `memory = "both"` reports "memory consumption in Mb in addition to the timings", i.e. the unit is megabytes. How

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-11 Thread Daniel Nordlund
x(ids, na.rm = TRUE) : no non-missing arguments to max; returning -Inf Hope this helps, Rui Barradas After playing with this for a little while, I realized that the problem with plotting the confidence limits is the addition of ylim(470, 500).  The confidence values are outside the y

Re: [R] free_port returning only one port...

2023-01-08 Thread Daniel Nordlund
nt port on each invocation free_port(random=TRUE) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA -- This email has been checked for viruses by Avast antivirus software. www.avast.com __ R-help@r-project.org mailing list -- To U

Re: [R] Issues when trying to fit a curve when generating random deviates

2022-09-18 Thread Daniel Nordlund
27;t see the code you used to generate the curve. What kind of curve are you trying to plot, and why are you trying to plot that curve? As Rui suggested, it typically doesn't make sense to use line plots to represent discrete data.  If you explain what your end goal is, someone may be able t

Re: [R] Date and Time

2022-07-17 Thread Daniel Nordlund
01  7:28:10' > dt <- strptime(in_dt_str,'%Y-%m-%d %H:%M:%S') if the date and time are stored in different variables then paste them together before converting > in_dt <- '2022-01-01' > in_tm <- '7:28:10' > dtm <- strptime(paste(in_dt, in_tm

Re: [R] bootstrap CI of the difference between 2 Cramer's V

2022-06-05 Thread Daniel Nordlund
is your friend here, search for    "R Goodman Kruskal gamma" Since this is looking like homework to me, I suggest you ask your instructor about some of this. Best of luck, Dan On 6/5/2022 9:21 AM, varin sacha wrote: Dear Daniel, Dear R-experts, I really thank you a lot Daniel. N

Re: [R] Dates as headers causing confusion but needed to convert to Julian days for ANOVA

2021-10-25 Thread Daniel Nordlund
quot;date" functions to get what you want. For example # pivot your data data_long <- data %>% pivot_longer(starts_with("X"), names_to = "chr_date", values_to = "LST") # now you can use various data functions to get your month, day, and year # for exampl

Re: [R] How to plot dates

2021-03-16 Thread Daniel Nordlund
e, "1 day"), unit="secs")) # plot event date by time grouped by date ggplot(myDat, aes(x=tme, y = dte, group = dte)) + geom_line() + geom_point() +    expand_limits(y=as.Date(c('20210301', '20210331'),'%Y%m%d'

Re: [R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread Daniel Nordlund
close)) AAPL %>%   ggplot(aes(x = date, y = close)) +   geom_line() +   labs(title = "AAPL", y = "Closing Price", x = "") +   coord_x_date(xlim=xminmax, ylim=yminmax) +   theme_tq() Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA ___

Re: [R] 回复: high-frequency data in R

2020-11-24 Thread Daniel Nordlund
-- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. You have the wrong format for your date

Re: [R] Export R outputs to SAS dataset

2020-08-24 Thread Daniel Nordlund
to help you more, but I will need to better understand what it is that you want to get back into SAS. Dan On 8/23/2020 6:46 AM, Jomy Jose wrote:  Hi Daniel Thanks,please find the code and output  #R libraries-       library(tidyverse)       library(MF) MFSubj(lesion ~ gr

Re: [R] Export R outputs to SAS dataset

2020-08-22 Thread Daniel Nordlund
ut in your SAS log or listing. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/pos

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Daniel Nordlund
UBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Works fine in Windows 10 64-bit with R-4.0.2, so I would echo Bert Gunter's ad

Re: [R] Strange behavior when sampling rows of a data frame

2020-06-19 Thread Daniel Nordlund
for me. df[sample(nrow(df),3), 'treated'] <- TRUE Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] How to convert European short dates to ISO format?

2020-06-10 Thread Daniel Nordlund
On 6/10/2020 1:20 AM, Luigi Marongiu wrote: isoDates = as.Date(oriDates, format = "%m/%d/%y") You need to use the format for European short dates. isoDates = as.Date(oriDates, format = "%d/%m/%y") Hope this is helpful, Dan -- Daniel Nordlund Po

Re: [R] [EXTERNAL] Attribute Combinations

2020-05-21 Thread Dalthorp, Daniel via R-help
# assuming your data frame is named "x", you can get the counts of each combo: table(do.call(paste0, x)) # and to get the proportions: table(do.call(paste0, x))/nrow(x) -Original Message- From: R-help On Behalf Of Jeff Reichman Sent: Thursday, May 21, 2020 10:22 AM To: R-help@r-proje

Re: [R] Add Gauss normal curve ?

2020-04-11 Thread Daniel Nordlund
-04-08","2020-04-09","2020-04-10")) nc<-c(1,1,2,7,3,6,6,20,17,46,67,71,56,70,85,93,301,339,325,226,608,546,1069,1264,1340,813,608) plot(as.Date(mydates),nc,pch=16,type="o",col="blue",ylim=c(1,1400), xlim=c(min(as.Date(mydates)),max(as.Date(mydates

Re: [R] [EXTERNAL] Re: "chi-square" | "chi-squared" | "chi squared" | "chi square" ?

2019-10-21 Thread Dalthorp, Daniel via R-help
igma^2 or x^2 or r^2. On Mon, Oct 21, 2019 at 9:46 AM Ivan Krylov wrote: > On Fri, 18 Oct 2019 15:25:59 -0700 > "Dalthorp, Daniel via R-help" wrote: > > > I'd like to see the statistics on it before jumping to a conclusion > > that the American preference is

Re: [R] [EXTERNAL] Re: "chi-square" | "chi-squared" | "chi squared" | "chi square" ?

2019-10-18 Thread Dalthorp, Daniel via R-help
oh my... I'd like to see the statistics on it before jumping to a conclusion that the American preference is "chi-square" and the British preference is "chi-squared". I don't see that at all. -- In keeping with the pronunciation of x^2 and 3^2, maybe "chi-squared" makes the most sense,. The

Re: [R] Capturing positive and negative changes using R

2019-07-21 Thread Daniel Nordlund
Here is one more option using the ave() function. Using Jim's data and naming convention fkdf$X1_change <- ave(fkdf[,'X1'], fkdf$Country, FUN=function(x) c(0,diff(x))) fkdf$X2_change <- ave(fkdf[,'X2'], fkdf$Country, FUN=function(x) c(0,diff(x))) hope t

[R] cannot install gsl from source?

2019-06-18 Thread Dalthorp, Daniel via R-help
I've been working on a fairly extensive R package for a few years with ongoing testing with Travis CI. Today, though, I'm seeing an error in installing the gsl package both at Travis and from the Windows GUI: install.packages("gsl",repos = getOption("repos"), repo=NULL, type="source") # gives the

Re: [R] Nested structure data simulation

2019-05-18 Thread Daniel Nordlund
e sense to include both in your model. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project

Re: [R] Downloading R Data

2019-04-14 Thread Daniel Nordlund
. If you wish to do something else, you will need to be more specific about what you want. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] [EXTERNAL] Re: create

2019-04-13 Thread Dalthorp, Daniel via R-help
how about one of the following? vdat$xy <- 2 * (ifelse(is.na(vdat$x1), 0, vdat$x1)) + 5 * (ifelse(is.na(vdat$x2), 0, vdat$x2)) + 3 * (ifelse(is.na(vdat$x3), 0, vdat$x3)) vdat$xy <- ifelse(is.na(as.matrix(vdat[, paste0("x", 1:3)])), 0, as.matrix(vdat[, paste0("x", 1:3)])) %*% c(2, 5, 3) On Sat, A

Re: [R] Rank ANCOVA

2019-03-14 Thread Jackson, Daniel
Thanks I am now in personal communication with Frank anyway! Dan -Original Message- From: peter dalgaard Sent: 14 March 2019 10:37 To: Jackson, Daniel Cc: r-help@r-project.org Subject: Re: [R] Rank ANCOVA 1. This is the R-help mailing list, not "Frank and Dennis" 2. You

[R] Rank ANCOVA

2019-03-13 Thread Jackson, Daniel
Hi Frank and Dennis I am in a similar situation but I would prefer to use a proportional odds model. 2 questions. 1. Has rank ancova been implemented in R now, despite its short comings? 2. Where has it been shown to yield unreliable analyses? I would like this evidence (which I believe

Re: [R] Newton-RaphsonMethod

2019-02-24 Thread Daniel Nordlund
h I will leave the solution of the problem to you. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide htt

Re: [R] seq() problem with chron

2018-09-06 Thread Daniel Nordlund
- strptime("02/20/13 00:00:00", "%m/%d/%y %H:%M:%S") dt2 <- strptime("07/03/18 15:30:00", "%m/%d/%y %H:%M:%S") dt <- seq(from=dt1, to=dt2, by=900) dt[length(dt)] There might also be some useful functions in the lubridate package. Hope this is helpful, D

Re: [R] Converting chr to num

2018-08-19 Thread Daniel Nordlund
rrences of '%'. The pattern is more strict, and that could cause the conversion to fail if the process that created the strings resulted in trailing spaces. Without the '$' the conversion succeeds. df <- data.frame(variable = c("12.6% ", "30.9%", &quo

Re: [R] Rendo and dataMultilevelIV

2018-08-02 Thread Daniel Nordlund
to above (which describes the dataMultilevelIV dataset)? Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Help with transpose please.

2018-06-23 Thread Daniel Nordlund
x27;Dx',ave(rep(1, nrow(have)), have[,1:2], FUN = seq_along), sep='') # cast the data into wide format cast(cbind(have,dxnames), ClaimServiceID + ClaimID ~ dxnames, value='DiagnosisCode') Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __

Re: [R] Cannot Load A Package

2018-06-02 Thread Daniel Nordlund
ary(devtools) install_github("kasperwelbers/semnet") Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Using tryCatch in a for loop

2018-05-22 Thread Daniel Nordlund
object does not have 3 rows, so you get an error and SlopeDiff is not created. You need to correct these problems, and any others, so that your code runs correctly when there are no data problems. Then you can worry about trapping errors in the case where there are data problems. Hope this i

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Daniel Nordlund
median squared error", shouldn't the final line of the function be median((y - ypred)^2) Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread Daniel Nordlund
(i in 1:10) lst[i] <- i mean(lst) # does not work The documentation for mean, ?mean, says that it is looking for a numeric or logical vector. To convert your list to a numeric vector you could unlist() it. mean(unlist(lst)) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend,

Re: [R] Empirical density estimation

2018-03-11 Thread Daniel Nordlund
this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter wrote: You need to re-read ?density and perhaps think again -- or do some study -- about how a (kernel) density estimate works. The points at which the estimate is calculated are *not*

Re: [R] How to turn off warnings about class name conflicts

2018-02-14 Thread Daniel Nordlund
d not get the message you are getting. I suspect you have something in your workspace that is causing the problem. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/m

Re: [R] command line fails

2018-02-02 Thread Daniel Nordlund
ading Tools/RV Tools/myfile.r" I don't know how rscript handles the '\' character (i.e. as an escape or not) so I changed the '\' to '/' just to be safe. And note, the program pathname and the file being passed need to

Re: [R] Simulation based on runif to get mean

2018-01-30 Thread Daniel Nordlund
at your real world task actually is. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

[R] IBM Power vs Markdown

2018-01-19 Thread Daniel King
# tail markdown/src/html_blocks.h if (key <= MAX_HASH_VALUE && key >= 0) { register const char *s = wordlist[key]; if unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == &#

Re: [R] Missing information in source()

2017-11-07 Thread Daniel Nordlund
On 11/7/2017 12:01 PM, Tom Backer Johnsen wrote: Dear R-help, I am running a Mac under Sierra, with R version 3.4.2 and RStudio 1.1.383. When running head () or tail () on an object in a script using source (

Re: [R] Count non-zero values in excluding NA Values

2017-10-29 Thread Daniel Nordlund
minimal, self-contained, reproducible code. this looks like a good place for apply() apply(data,2,function(x) sum(x != 0, na.rm=TRUE)) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSU

Re: [R] Help needed with aggregate or other solution

2017-10-26 Thread Daniel Nordlund
0:00", "2012-04-24 06:00:00", "2012-04-24 12:00:00", "2012-04-24 18:00:00", "2012-04-25 00:00:00", "2012-04-25 06:00:00", "2012-04-25 12:00:00", "2012-04-25 18:00:00", "2012-04-26 00:00:00", "2012-04-26 06:00:0

[R] S-mode PCAs

2017-06-13 Thread Daniel Vecellio
? Thanks in advance, Dan -- *Daniel J. Vecellio* *Ph.D. Student - Climate Science Lab, **Department of Geography, **Texas A&M University* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] display double dot over character in plotmath?

2017-05-12 Thread Daniel Nordlund
y making sure the NUMLOCK key is on, hold down the alt key and press 0228 on the numeric keypad. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.eth

[R] Unusual behavior in e1071?

2017-05-01 Thread Daniel Jeske
assify as +1 if f(x)>0. Does anyone think the behavior I have noticed is as intended, or is otherwise benign? Thank you, Daniel Jeske Professor Department of Statistics University of California - Riverside [[alternative HTML version deleted]] ___

[R] Question on accessing foreign files

2017-04-18 Thread Daniel Molinari
Hi all, I have several data files provided in mtw format (Minitab) and sdd format (S-Plus) and I need to read them in R. I do not have access either to Minitab or to S-Plus. How can I accomplish this task ? Thank you, Daniel [[alternative HTML version deleted

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
400, Boris Steipe wrote: I discourage the use of print() for debugging. Put a browser() statement into your loop and when execution takes you to the debugger interface, examine your variables and expressions one by one. B. On Apr 4, 2017, at 10:09 AM, DANIEL PRECIADO mailto:danp...@h

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
ironment to list, as in: f <- function() ls(.GlobalEnv) f() [1] "f" "foobar" On 4 Apr 2017, at 12:27 , DANIEL PRECIADO mailto:danp...@hotmail.com>> wrote: Thanks, but printing doesn't work within the function either. (i.e, no result or output, or error).

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
th > the same as last week? > > -pd > > > > On 4 Apr 2017, at 10:50 , DANIEL PRECIADO > > wrote: > > > > The following function is supposed to search the workspace and save > > plots  (i.e. listing all objects in the workspace named "Figs", >

[R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
The following function is supposed to search the workspace and save plots  (i.e. listing all objects in the workspace named "Figs", which are all ggplot2 plots, and saving them as png files) SaveFigs <- function() { for (i in ls(pattern="_Figs_")) { filename = paste

[R] nlmrt problems - No confInt, NA StdErr, t-, or p-values

2017-03-21 Thread DANIEL PRECIADO
Dear list, I want to use nlxb (package nlmrt) to fit different datasets to a gaussian, obtain parameters (including standard error, t-and p-value) and confidence intervals. nlxb generates the parameters, but very often results in NA standard error,t-and p-values. Furthermore, using confint() t

[R] nls fitting & plotting to data subsets defined by combinations of categorical variables

2017-03-11 Thread DANIEL PRECIADO
Dear list, I want to apply the same nls function to different subsets of a larger dataset. These subsets are defined as unique combinations of two (categorical) variables, each one with two levels, so I should obtain 4 sets of parameters after fitting. I have managed to do it in a loop, creatin

Re: [R] Reverse the scoring of some Columns of a Data Set

2017-03-08 Thread Daniel Nordlund
):1]) Hope this helps, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/post

Re: [R] [FORGED] how to draw the confidence interval

2017-03-06 Thread Daniel Nordlund
o generate your random samples, and then describe what you want, e.g. "plot sample means and standard errors estimated from the samples," we can play along at home. Then you may get some usable help. You could also Google something like "R plot means and standard errors&qu

Re: [R] [FORGED] Export Forecasted output to a table (excel)

2017-02-01 Thread Daniel Nordlund
DON'T use Excel. Ever. See: http://www.stat.uiowa.edu/~jcryer/JSMTalk2001.pdf cheers, Rolf Turner Unfortunately, that link appears to be broken / does not exist anymore. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mail

Re: [R] Getting Started

2017-01-10 Thread Dalthorp, Daniel
By "contribute", do you mean you have a package (or potential package) that you'd like to share? Or do you have something else in mind? -Dan On Tue, Jan 10, 2017 at 9:33 AM, Lakshya Agrawal wrote: > Hello, > I would like to contribute to R i have gone over the development page but > could find

Re: [R] package ‘Rccp’ is not available (for R version 3.3.2)

2016-12-09 Thread Daniel Nordlund
at.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Should that be the Rcpp package and not Rccp? Dan -- Daniel Nordlund Port Townsen

[R] ggplot2, qplot, problems

2016-12-05 Thread Daniel
1: `stat` is deprecated 2: `position` is deprecated > plot <- plot + facet_grid(type ~ subjectname) > plot Error: stat_count() must not be used with a y aesthetic. ------- tha

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Dalthorp, Daniel
Try David's suggestion to spell the argument "stringsAsFactors" correctly. Then: data <- read.table("your_file_location", sep ="\t", comment.char = "", stringsAsFactors = F, header = T) transpose_data <- t(data) -Dan On Tue, Nov 29, 2016 at 9:56 AM, Elham - via R-help wrote: > yes you have rig

[R] on ``unfolding'' a json into data frame columns

2016-11-29 Thread Daniel Bastos
Greetings! In an SQL table, I have a column that contains a JSON. I'd like easy access to all (in an ideal world) of these JSON fields. I started out trying to get all fields from the JSON and so I wrote this function. unfold.json <- function (df, column) { library(jsonlite) ret <- data

Re: [R] reshaping a large dataframe in R

2016-11-28 Thread Daniel Nordlund
n? Thanks in advance, best Jean-Philippe I don't know about efficiency, but it looks like you could do something like this: y <- t(matrix(t(dataGaus),4)) Maybe someone will come along with something better, Dan -- Daniel Nordlund Port

Re: [R] tcltk table "validateCommand"

2016-11-17 Thread Dalthorp, Daniel
function. > > > > As far as I remember, this only works at entry completion, though. That > does sort of make sense since not every prefix of a valid entry is valid > ("1e-2" is a double, "1e-" is not). If you want to actually disable certain > keys durin

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
> > On Wed, Nov 9, 2016 at 5:45 PM, Dalthorp, Daniel > wrote: > >> Hi Milu, >> The following should work for an array x (provided dim(x)[2] is divisible >> by 4): >> >> colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) >> >> -Dan >> >> On Wed, Nov

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
, Nov 9, 2016 at 5:45 PM, Dalthorp, Daniel > wrote: > >> Hi Milu, >> The following should work for an array x (provided dim(x)[2] is divisible >> by 4): >> >> colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) >> >> -Dan >> >> On Wed, Nov 9, 2016 at 8

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
Hi Milu, The following should work for an array x (provided dim(x)[2] is divisible by 4): colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) -Dan On Wed, Nov 9, 2016 at 8:29 AM, Miluji Sb wrote: > Dear all, > > I have a dataset with hundreds of columns, I am only providing only 12 > columns. Is it possible t

Re: [R] About reshape dataset

2016-10-22 Thread Daniel Nordlund
e along with a "better" answer, but I played with this a bit and this is what I came up with. After running your code I ran DF2$site <- substr(as.character(DF2$variable),1,5) DF2$var <- substr(as.character(DF2$variable),7,10) DF3 <- cast(DF2,year +

Re: [R] Cannot install package write.xls

2016-10-07 Thread Daniel Nordlund
sion 3.3.1) What can I do? As far as I know, write.xls and write.table are not packages, they are functions. There is a write.xls function in the xlsx (and also the openxlsx) package and write.table is a built-in R function that exists in the util package. Dan -- Daniel Nordlund Port Townsen

Re: [R] (no subject)

2016-10-06 Thread Dalthorp, Daniel
t; Jim > > On Fri, Oct 7, 2016 at 9:48 AM, Dalthorp, Daniel > wrote: > > Question and answer: > > > > 6*9 = (4)*13^1 + (2)*13^0 > > > > On Thu, Oct 6, 2016 at 3:26 PM, Jim Lemon wrote: > >> > >> It certainly does. As we are often confronted with

Re: [R] (no subject)

2016-10-06 Thread Dalthorp, Daniel
Question and answer: 6*9 = (4)*13^1 + (2)*13^0 On Thu, Oct 6, 2016 at 3:26 PM, Jim Lemon wrote: > It certainly does. As we are often confronted with requests for > solutions of problems so minimally defined as to challenge the most > eminent mindreader, this excels. We have a meta-problem as th

Re: [R] Bootstrapping in R

2016-10-01 Thread Daniel Nordlund
ing the same answer." Someone may then be able to do more than guess at what the problem is. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Writing data onto xlsx file without cell formatting

2016-09-26 Thread Daniel Nordlund
d document will help: https://cran.r-project.org/web/packages/xlsx/xlsx.pdf Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Daniel Nordlund
nd > strptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p") [1] "2016-08-25 18:34:00 PDT" works for me. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org

Re: [R] Rotating points, preferably in grid

2016-08-24 Thread Dalthorp, Daniel
Silly? Not really. It's simple. It works. You could jump into unicode for your text and make it look nicer, e.g., using '\u2191' or some other shape in place of 'T' http://unicode.org/charts/ http://unicode.org/charts/PDF/U2190.pdf -Dan On Wed, Aug 24, 2016 at 7:16 PM, Thomas Levine <_...@thom

[R] problem concernig Survsplit, package survival

2016-08-22 Thread Wollschlaeger, Daniel
' were specified. A corrected pdf of the chapter is available at http://dwoll.de/r/gddmr/09_survival.pdf Daniel Wollschlaeger On August 19, 2016 4:21:31 AM PDT, "Vinzenz Völkel via R-help" wrote: >Dear R-help-community, > > > >I hope, that?s the appropiate channel to

Re: [R] R bug when started in Windows 10

2016-08-14 Thread Daniel Nordlund
producible exampole, I did notice one problem in the example you did give of a directory with spaces. It looks like you were using single quotes (') around the path/filename. Windows requires that there be double quotes (") around any path/filenam

Re: [R] SAS file

2016-08-07 Thread Daniel Nordlund
need to get an XPORT format file, or have SAS available, or get some 3rd party software that will read SAS datasets. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz

Re: [R] I'm getting confused with notation and terminology in output from weibull parametric survival model from survreg()

2016-07-29 Thread Dalthorp, Daniel
The parameterization for Weibull in the 'survival' package corresponds to base R's dweibull, etc. suite as 1/scale --> shape and exp(coef[1]) --> scale On Fri, Jul 29, 2016 at 1:07 PM, Christopher W. Ryan wrote: > I'm trying to run a Weibull parametric survival model for recurrent event > data,

Re: [R] font size in graphs...can R read Windows settings?

2016-07-28 Thread Dalthorp, Daniel
; las = 1, > > mai = c(0.85, 0.85, 0.32, 0.12), > > font.main = 1, > > cex.main = 1.0, > > cex.lab = 1.0, > > cex.axis = 0.9) > > > > Duncan > > > > *From:* Dalthorp, Daniel [mailto:ddalth...@usgs.gov] > *Sent:* F

Re: [R] font size in graphs...can R read Windows settings?

2016-07-28 Thread Dalthorp, Daniel
ue"))), > type = "b") > > Regards > > Duncan > > Duncan Mackay > Department of Agronomy and Soil Science > University of New England > Armidale NSW 2351 > Email: home: mac...@northnet.com.au > > -Original Message- > From: R-

[R] font size in graphs...can R read Windows settings?

2016-07-27 Thread Dalthorp, Daniel
Hi All, I am putting together a package that (among other things) draws some nice graphs for users. I place some explanatory text on figs using "text" and "mtext". But the size of the text depends on the Windows display settings: Smaller (100%), medium (125%) or larger (150%) (In Windows 7... Contr

Re: [R] how to expand the dataframe

2016-07-21 Thread Daniel Nordlund
ong at home" (i.e. give us a reproducible example). Dan Daniel Nordlund Port Townsend, WA -- Daniel Noredlund Bothell, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] Sampe numbers

2016-07-19 Thread Daniel Nordlund
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code

Re: [R] tclArray() --- "active"?!

2016-07-06 Thread Dalthorp, Daniel
cell, and that the widget needs to record > the fact that there is now no active cell.) > > -pd > > > > On 06 Jul 2016, at 16:18 , Dalthorp, Daniel wrote: > > > > Sometimes when working with tclArray's, an empty element called "active" > is >

[R] tclArray() --- "active"?!

2016-07-06 Thread Dalthorp, Daniel
Sometimes when working with tclArray's, an empty element called "active" is appended to the array. Does anyone know when (and why) this happens? And how to prevent it (or at least predict it so that it can be removed by hand)? E.g., library(tcltk); library(tcltk2) tt<-tktoplevel() dat<-tclArray()

  1   2   3   4   5   6   7   8   9   10   >