Professional Documents
Culture Documents
CSA 41 Ds Exp1
CSA 41 Ds Exp1
Div: A Batch: 2
Date of performance:
Experiment No.1
Aim: i. To explore the dataset for different case study examples with different commands.
ii. To plot the Box plot and scatter plot.
Code Statement:
1. Write a single R code to display the answers for the following questions.
3. Write a single R code to display the answers for the following questions
1. What is the average number of seeds germinated for the uncovered boxes with level of watering
equal to 4?
2. What is the median value for the data covered boxes?
Establish conclusions on the basis of available data and write them in the conclusion part.
a. Association of levels of watering with the number of germinating seeds in case of covered
boxes as well as uncovered boxes.
b. Association of number of germinating seeds with the fact that the boxes were covered or
uncovered.
Expected Boxplot:
Bansilal RamnathAgarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY – PUNE
Department of SY Common
Code:
n <- nrow(f)
cat("\nNumber of observations: ", n)
print(tail(f,2)) #cat does not support data frames, thats why we used print
oz <- f$Ozone[47]
oz
cat("\nOzone in 47th row: ", oz)
ms <- sum(is.na(f$Ozone))
cat("\nNumber of missing values in Ozone column: ", ms)
bh<-sum(f2$Hair.Color=="Blonde")
cat("\nNo. of people having Blonde hair color:",bh)
bhbe<-sum(f2$Hair.Color=="Brown"&f2$Eye.Color=="Black")
cat("\nNo. of people having brown hair and black eyes:",bhbe)
green<-(sum(f2$Eye.Color=="Green")/nrow(f2))*100
cat("\nPercentage of people with green eyes:",green,"%")
rb<-(sum(f2$Hair.Color=="Red"&f2$Eye.Color=="Blue")/nrow(f2))*100
cat("\nPercentage of people have red hair and blue eye:",rb,"%")
Results
Bansilal RamnathAgarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY – PUNE
Department of SY Common
1. In case of covered boxes, as the water level increases till 3, the no of seeds germinated
increases and after that the no of seeds germinated decreases. In case of uncovered boxes,
as the water level increases, the no of seeds germinated increases.
2. The number of seeds germinated does not only depend whether the box is covered or
uncovered but also depends on the level of watering.
Bansilal RamnathAgarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY – PUNE
Department of SY Common