R_Code-7.r ​
Metadata ​
- Author — Amit Dutta (amitdutta4255@gmail.com)
- Last updated — 19 Mar 2026
- License — MIT
Problem Statement ​
Problem Statement
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 ​
Printing the code
To print this file, open it on GitHub and click Raw before printing, or use the Download Raw button above and print directly from that page.
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