#B library(MASS) survey library(dplyr) A=complete.cases(survey) survey_c=survey[A,]
#How many male and female students participated in the survey? as.data.frame(table(survey_c$Sex))
#How many the left and right handers are there? as.data.frame(table(survey_c$W.Hnd))
#Find the relative frequency distribution of left and right handers and display them #with the precision of two decimal places. A=as.data.frame(table(survey_c\(W.Hnd)) A['Freq']=A['Freq']/length(survey_c\)W.Hnd)
#What percentage of male left handers never smokes? library(dplyr) k=filter(survey_c, survey_c\(Smoke == "Never"&survey_c\)Sex== “Male”&survey_c$W.Hnd==“Left”) print(paste(“The no of Male left handers never smoke is:”,nrow(k)/nrow(survey_c)))
Sys.time()