打开R语言或RStudio

02

我们想让R语言自动循环5次,每次都输出111,则代码如下:

for(i in 1:5) print(111)

03

假如我们想让这5次分别输出1、输出2、输出3...到输出5,则代码如下:

for(i in 1:5) print(i)