[R] 'programatically' list or call objects for use in a function?

Karl Brand k.brand at erasmusmc.nl
Sat Sep 11 14:00:03 CEST 2010


Esteemed R users and developers,

How does one 'programatically' list or call objects for use in a function?

For example, i thought i could do something better than this:

save(A.cwb, B.cwb, C.cwb, D.cwb, E.cwb, F.cwb, file="afile.RData")

with something like these-

prfxs <- c("A", "B", "C", "D", "E", "F") #**
save(as.name(paste(prfxs, "cwb", sep=".")), file="afile.RData")

or this-

do.call(save, paste(prfxs, "cwb", sep="."), file="afile.RData")

Both failed.

#** And while i've got your attention- is there a 'letter equivalent' to 
seq() which would have worked nicely for prfxs? ie., letter.seq(A:F)

Thoughts and suggestions sincerely appreciated,

Karl



-- 
Karl Brand
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
T +31 (0)10 704 3457 |F +31 (0)10 704 4743 |M +31 (0)642 777 268



More information about the R-help mailing list