R_Prac-6.r ​
Metadata ​
- Author — Amit Dutta (amitdutta4255@gmail.com)
- Last updated — 25 Mar 2026
- License — MIT
Problem Statement ​
Problem Statement
Program to access List elements, modify a List Element, add items to List, Remove items from a List, length of List.
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: 25 Mar 2026
# Repo: https://github.com/notamitgamer/bsc
# License: MIT
# Program to access List elements, modify a List Element, add items to List,
# Remove items from a List, length of List.
l <- list("Amit", 19, "Madhyamgram", 94.5)
print("Initial list:")
print(l)
l[[4]] = 95.46
print("after modifing last element: ")
print(l)
l[length(l) + 1] <- "hello"
print("after adding new element:")
print(l)
l[3] <- NULL
print("after deleting a element: ")
print(l)
print(paste("length of the list after modifing:", length(l)))1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24