首页 > 其他 > 详细

R语言常用基础知识

时间:2014-06-07 21:47:38      阅读:407      评论:0      收藏:0      [点我收藏+]

seq(from = 1, to = 1, by = ((to - from)/(length.out - 1)),
    length.out = NULL, along.with = NULL, ...)

举例----------Examples----------
seq(0, 1, length.out=11)
seq(stats::rnorm(20)) # 
seq(1, 9, by = 2)     # 
seq(1, 9, by = pi)    # 
seq(1, 6, by = 3)
seq(1.575, 5.125, by=0.05)
seq(17) # same as 1:17, or even better seq_len(17)

 

Loops

The most commonly used loop structures in R are for, while and apply loops. Less common are repeat loops. The break function is used to break out of loops, and next halts the processing of the current iteration and advances the looping index.

for(variable in sequence) {
    statements
}

while(condition) statements
apply(X, MARGIN, FUN, ARGs)
 

R语言常用基础知识,布布扣,bubuko.com

R语言常用基础知识

原文:http://www.cnblogs.com/emanlee/p/3774851.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!