Re: [R] Put names in the elements of lapply result

2011-05-30 Thread Kenn Konstabel
On Fri, May 27, 2011 at 6:12 PM, Bert Gunter wrote: > Jonathan et. al: > > Yes, of course, but I'd say Type III error: Right answer to wrong question. > The real question (imho only obviously) is: "What data structure > should be used?" -- and the standard answer for this sort of thing in > R is:

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Bert Gunter
Jonathan et. al: Yes, of course, but I'd say Type III error: Right answer to wrong question. The real question (imho only obviously) is: "What data structure should be used?" -- and the standard answer for this sort of thing in R is: "A list, of course." That is: myparams <- list(EMAX, EC50,KOU

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Eik Vettorazzi
yes, it is possible using sapply sapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2)),USE.NAMES=T,simplify=F) hth. Am 27.05.2011 16:58, schrieb Jun Shen: > Hi, Jonathan, > > It surely worked. I was only thinking how to do it within lapply and didn't > look at the pr

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Jun Shen
Hi, Jonathan, It surely worked. I was only thinking how to do it within lapply and didn't look at the problem outside the box? Thanks. Jun On Fri, May 27, 2011 at 9:47 AM, Jonathan Daily wrote: > Does this work for you? > > dat <- > lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(g

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Jonathan Daily
Does this work for you? dat <- lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2))) names(dat) <- c('EMAX','EC50','KOUT','GAMMA') On Fri, May 27, 2011 at 10:03 AM, Jun Shen wrote: > Dear list, > > I am running some linear regressions through lapply, > >>lapply(c('

[R] Put names in the elements of lapply result

2011-05-27 Thread Jun Shen
Dear list, I am running some linear regressions through lapply, >lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2))) I got results like [[1]] 2.5 % 97.5 % (Intercept) 0.6595789212 0.8821691261 RR0 -0.0001801771 0.0001489083 [[2