On Thu, 30 Jan 2003, John Hendrickx wrote: > The only problem though is the last step, specifying a list of varying > variables. It should be possible to generate this from "names(dset)" > but I can't get it right. "as.list(rep(names(dset),2))" produces a > list with four elements rather than a list with 2 components each > containing two elements. "dim()" gives a matrix as a result. Could > someone show me how to create "list(x1=c("X1","X1"),x2=c("X2","X2"))" > from "names(dset)"?
lapply(names(dset),rep,2) gives [[1]] [1] "X1" "X1" [[2]] [1] "X2" "X2" -thomas ______________________________________________ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help