Description Usage Arguments Value Examples
rep_ is a 'better' implementation of the rep (repeat) base R function
1 |
x |
Vector |
times |
Number of times to repeat the vector |
each |
Number of times to repeat each element in the vector |
A vector
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #rep_(c("A","B","C"),each=c(1,2,3))
#lst<-c(letters[1:4])
#rep(lst,times=c(1,1,4,4,3,3,2,2),each=2)
#rep_(lst,times=2,each=c(1,4,3,2))
#x<-letters[1:4]
#rep(x,times=3)
#rep_(x,times=3)
#rep(x,each=3)
#rep_(x,each=3)
#rep(x, each=c(1,2,3,4))
#rep(x, times=c(1,2,3,4))
#rep_(x, each=c(1,2,3,4))
#rep(x,times=c(1,2,3,4),each=2)
#rep_(x,times=2,each=c(1,2,3,4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.