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
# Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 19 Mar 2026
# Repo: https://github.com/notamitgamer/bsc
# License: MIT
# 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
7
8
9
10
2
3
4
5
6
7
8
9
10
● Author - Amit Dutta · Updated - 19 Mar 2026