Group 11 - Lab5
Group 11 - Lab5
#LAB 5
#
# SHARVINA UTHAYA SHANKAR 225443
#CAMELIA LEOVERA FRANCIS 225891
#SHRITHAR NAIIDU A/L RAMESH KUMAR 224327
#MUHAMMAD ADY AQMAL BIN ZAFRY 217684
#27 NOV 2024
#Question 1
(f)Get the missing values in the Ozone column. How many of them?
> sum(is.na(x[,1]))
[1] 37
(g)Get the mean of the Ozone column. Exclude the missing values from the calculation
> mean(na.omit(x[,1]))
[1] 42.12931
(d)Extract a specific column from the data frame using the column name
> data.frame(y$name)
y.name
1 Ali
2 Diana
3 Karim
4 Jannah
5 Ehsan
6 Muhammad
7 Maryam
8 Laila
9 Kasim
10 Jamil
(o)Save the data frame in a csv file and open it using excel
> save(k, file = "k.csv")
> write.csv(k,file="data.csv", row.names = FALSE)