rep() Function in R (4 Examples)
rep() is a built-in R function thatĀ replicates the values in the provided vector. This tutorial shows how to use rep() function in R with 4 examples. Example 1 The following code is to repeat the number 4 twice. Output: [1] 4 4 Example 2 Output: [1] 1 2 3 1 2 3 1 2 3 … Read more