R_Code-7.r
Problem Statement
R_Code-7.r
Create a numerical vector containing the sequence of numbers from 1 to 5 using the : operator. Then, use the rep() function with the times argument to repeat that entire sequence exactly 2 times.
Source Code
r
# Create a numerical vector containing the sequence of
# numbers from 1 to 5 using the : operator. Then, use the rep()
# function with the times argument to repeat that entire sequence exactly 2 times.
s <- rep(c(1:5), times= 2)
print(s)1
2
3
4
5
6
2
3
4
5
6