【发布时间】:2018-11-18 14:56:56
【问题描述】:
我想重复每一个
repeat.it <- c(0, 3951982, 7635488, 10986941)
按次:
repeat.times<- c(2L, 3L, 4L, 2L)
并得到结果:
0,0,3951982,3951982,3951982,7635488,7635488,7635488,7635488,10986941,10986941
我试过的代码:
rep(repeat.it, each=repeat.times) 但这似乎给了我错误的结果。我怎样才能正确地做到这一点?
【问题讨论】:
标签: r