我如何用R写下面的内容?
我试过使用我如何用R写下面的内容?,r,R,我试过使用rep等,但我只能得到一种颜色 使用rep和/或c,最多两次,每次最多两个参数 这是家庭作业吗?查看?rep…中的times参数试试c(rep('red',3),rep('green',2),rep('blue',1))不能使用rep 3次关于c(c(rep('red',3),rep('green',2)),“blue”)?是的!谢谢你,杰克 "red", "red", "red", "green", "green", "blue" rep(c("red", "green", "bl
rep
等,但我只能得到一种颜色
使用rep
和/或c
,最多两次,每次最多两个参数
这是家庭作业吗?查看
?rep
…中的times
参数试试c(rep('red',3),rep('green',2),rep('blue',1))不能使用rep 3次关于c(c(rep('red',3),rep('green',2)),“blue”)?是的!谢谢你,杰克
"red", "red", "red", "green", "green", "blue"
rep(c("red", "green", "blue"), c(3, 2, 1))