Replicate elements of vector in R programming - rep() Method
In the R programming language, A very useful function for creating a vector by repeating a given numbervector with the specified number of times is the rep(). The general structure of rep() : rep(v1,n1). Here, v1 is repeated n1 times. R - replicate elements of vector The forms of rep() functions : r