Re: [R] Populate a list / recursively set list values to NA

2011-02-17 Thread Gene Leynes
Works perfectly, thank you! On Thu, Feb 17, 2011 at 4:11 PM, Erik Iverson wrote: > Gene, > > ?rapply is a recursive version of ?lapply, and should work. > > rapply(masterlist, function(x) x*NA, how = "replace") > > > --Erik > > Gene Leynes wrote: > >> Hello all, >> >> Maybe I'm being thick, but

Re: [R] Populate a list / recursively set list values to NA

2011-02-17 Thread Erik Iverson
Gene, ?rapply is a recursive version of ?lapply, and should work. rapply(masterlist, function(x) x*NA, how = "replace") --Erik Gene Leynes wrote: Hello all, Maybe I'm being thick, but I was trying to figure out a simple way to create a list with the same dimension of another list, but popul

[R] Populate a list / recursively set list values to NA

2011-02-17 Thread Gene Leynes
Hello all, Maybe I'm being thick, but I was trying to figure out a simple way to create a list with the same dimension of another list, but populated with NA values. masterlist = list( aa=list( a=matrix(rnorm(100),10,10), b=matrix(rnorm(130)