> 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…
一.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…
转载请说明. R语言官网:http://www.r-project.org/ R语言软件下载:http://ftp.ctex.org/mirrors/CRAN/ 注:下载时点击 install R for the first time 下面进行一个简单的入门程序学习. 先新建一个txt,叫做 Rice_insect.txt 点我下载,内容为:(用制表符Tab) Year Adult Day Precipitation 1973 27285 15 387.3 1974 239 14…