Katharina May wrote:
Hi,

how can I use rm() on objects named like:
paste("site",i,"_data",sep="") while looping
through i?
I tried rm(paste("site",i,"_data",sep="")) but I get the error that
rm() must contain names or
text strings which is confusing me as I thought paste() would create
something like that...?


Well, I would try to avoid the creation of so many objects, but once you have them you can do even without a loop:

e.g. for the first 5:

i <- 1:5
do.call("rm", list(paste("site", i, "_data", sep="")))

Uwe Ligges


Thanks,


         Katharina




______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to