[英]How to call environment objects from names in vectors
There are the names of the objects (data_frames) in the specified environment.有指定环境中的对象名称(data_frames)。
ls()
[1] "a" "b"
I have assigned the names of the objects to a vector, eg n_obj <- c('a', 'b')
我已将对象的名称分配给向量,例如
n_obj <- c('a', 'b')
How to call my objects using the vector of the names n_obj
?如何使用名称
n_obj
的向量调用我的对象? n_obj[1]
return logical a string 'a', but I need to run 'a' as my saved dataframe 'a' in the environment. n_obj[1]
返回逻辑字符串 'a',但我需要在环境中运行 'a' 作为我保存的 dataframe 'a'。
I'd use the get function我会使用 get function
get(n_obj[1])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.