# creates table with column names
# and values assigned to them
Name <- c('Adrian','Nathan','Heather',
'Abby','Delight','Hope',
'Lucifer','Faith',14,'Joseph')
RollNo <- c(24,23,14,18,29,56,14,39,12,20)
ID <- c(123, 336, 134, 148, 14, 289, 856,
773, 201, 536)
CPI <- c(8.5, 8.3, 7.8, 9.1, 7.9, 6.7, 8.3,
7.11, 7.9, 14.0)
HostelRoom <- c(23, 45, 31, 66, 40, 14, 23,
14, 52, 10)
# stores it in the form of data frame
# with the name StudentDetails
StudentDetails <- data.frame(Name,RollNo,ID,CPI,HostelRoom)
# saves the original dataframe with
# the name sdetails
sdetails <- StudentDetails
# values less than or equal to 20,
# will be replaced by NA
sdetails$RollNo[sdetails$RollNo<=20] <- "NA"
# views the modified table
View(sdetails)