Usage
- ①assign(x, value, pos = -1, envir = as.environment(pos), inherits = FALSE, immediate = TRUE)
将value赋值给x; - ②get(x, pos=-1, envir=as.environment(pos), mode = "any", inherits = TRUE)
在指定环境中搜索名字为x的变量并返回它的值,x只能是一个字符; - ③mget:mget(x, envir = as.environment(-1), mode = "any", ifnotfound, inherits = FALSE);
与get类似,但是x可以为字符向量,返回list,每个子list对应一个字符
Example
assign、get、mget
网友评论