开发者

R implicit remove of object

ls() gives among others and the following object: object2remove

Next we have the following code:

variableIuse <- "object2remove"

The question 开发者_开发百科is:

How do I remove implicitly object2remove through the variableIuse?


You need to use the list parameter of the rm() function:

> object2remove <- 1:10
> variableIuse <- 'object2remove'
> rm(list = variableIuse) # remove variable named by variableIuse
> variableIuse            # still exists
[1] "object2remove"
> object2remove           # no longer exists
Error: object 'object2remove' not found
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜