search for: mylistofarbitraryth

Displaying 1 result from an estimated 1 matches for "mylistofarbitraryth".

2005 Dec 06
1
array of lists? is this the best way to do it?
...want to know if the following looks OK to you guys or if there is a better way to create an array of lists: # PREAMBLE ... JUST TO GET THINGS GOING makeList<- function(data, anythingElse) { rval <- list( data = data, anythingElse = anythingElse ) class(rval) <- "myListOfArbitraryThings" return(rval) } # make up some arbitrary data payload<- list( as.matrix(cbind(1,1:3)), 10:15, data.frame(cbind(x=1, y=1:10), fac=sample(LETTERS[1:3], 10, repl=TRUE)) ) # HERE'S THE ARRAY-CONSTRUCTION PART THAT I WANT CRITIQUED: n<- 3 # number of lists...