一.scale函数 R语言base库中自带数据标准化接口scale函数,函数介绍如下 Usage scale(x, center = TRUE, scale = TRUE) Arguments x: a numeric matrix(like object). center: either a logical value or a numeric vector of length equal to the number of columns of x. scale: either a logic
assign函数在循环时候,给变量赋值,算是比较方便 1.给变量赋值 for (i in 1:(length(rowSeq)-1)){ assign(paste("nginx_server_fields7_", i, sep = ""), nginx_server_fields7[(rowSeq[(i-1)+1]):(rowSeq[i+1]), ]) } 2.通过for循环给变量a1.a2.a3赋值 for (i in 1:3){ assign(paste(&quo
eval() 's first argument is an expression. So if you only provide one argument, it will evaluate the expression in the current environment. 假设环境中存在变量 x=10 eval(quote(x), list(x=30)) 相当于 首先, quote(x) 得到x 之后, list(x=30) x 于是得到30 如果是eval(x, list(x=30)),
> text <- c("we are the world", "we are the children") > sub("w", "W", text) [1] "We are the world" "We are the children" > sub("W","w",text) [1] "we are t