参考手册
参考手册
实例 R 语言 在函数外部创建变量,并在函数内部使用
源代码
运行代码
txt <- "awesome" my_function <- function() { paste("R is", txt) } my_function()
x
txt
<-
"awesome"
my_function
<-
function
() {
paste
(
"R is"
,
txt
)
}
my_function
()
输出结果
[1] "R is awesome"