[R] Remove objects names like character String
ronggui.huang at gmail.com
Tue May 19 17:01:33 CEST 2009
I don't get the error you mention:
> for (i in 1:3) paste("site",i,"_data",sep="")
In my example, another way is: rm(list=paste("site",1:3,"_data",sep=""))
Or you can use rm(list=ls(pattern=you pattern)), in my example, it is:
2009/5/19 Katharina May <may.katharina at googlemail.com>:
> 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...?
> Time flies like an arrow, fruit flies like bananas.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
HUANG Ronggui, Wincent
Dept of Public and Social Administration
City University of Hong Kong
Home page: http://asrr.r-forge.r-project.org/rghuang.html
More information about the R-help