Re: [R] lapply assign to list

2009-12-02 Thread Kenneth Roy Cabrera Torres
Yes... It assing to each list component the index... As you see I want to modify each component of the list so I can use it at the following step o the lapply procedure. El mié, 02-12-2009 a las 17:23 -0200, Henrique Dallazuanna escribió: > Try this: > > z1[] <- 1:3 > > > > On Wed, Dec 2, 20

Re: [R] lapply assign to list

2009-12-02 Thread Henrique Dallazuanna
Try this: z1[] <- 1:3 On Wed, Dec 2, 2009 at 5:17 PM, Kenneth Roy Cabrera Torres wrote: > Hi R users: > > I got an error that "l1" is not found. > > This is a sample code: > > f1<-function(i,l1){ >  print(l1[[i]]) >  l1[[i+1]]<<-i >  return(i) > } > > z1<-list(x=100,NULL,a=c(1,1)) > lapply(1:3

[R] lapply assign to list

2009-12-02 Thread Kenneth Roy Cabrera Torres
Hi R users: I got an error that "l1" is not found. This is a sample code: f1<-function(i,l1){ print(l1[[i]]) l1[[i+1]]<<-i return(i) } z1<-list(x=100,NULL,a=c(1,1)) lapply(1:3,f1,l1=z1) My final goal is to update the value of each list component to use it in the following step. I see th