This tutorial is about repeat function, rep().
To output 100 "1"s, instead of typing 1 for hundrend times, we should use repeat function, rep(1, each=100) or simplify as rep(1,100)
Here are some more examples:
rep(c(1,2,3,4),10)
rep(1:5,10)
rep(seq(1,50,5),10)
rep(c("NOR","IND","ARM","RUS","AZE"),8)
CloudStat is a platform to learn and do R on the Cloud. With CloudStat, there is no more download, installation, update and maintenance. CloudStat decreases the R language learning curve besides collaboration. And it's Free! Demo @ http://cloudst.at
CloudStat是一个云端统计平台,可以在线上做R统计与学习。没有下载,安装,更新和维护的需要。 CloudStat降低R语言的学习曲线,除了有协作功能,还是是免费的!演示@ http://cloudst.at
Link to this comment:
All Comments (0)