Q3_midterm.docx - Midterm exam Darryl S Monteiro...

This preview shows page 1 - 3 out of 5 pages.

Midterm examDarryl S Monteiro2021-03-06iris_data<-read.csv('C:\\Users\\darry\\OneDrive\\Desktop\\iris_exams.csv')str(iris_data)## 'data.frame': 300 obs. of 6 variables:## $ id : chr "S001" "S002" "S003" "S004" ...## $ Species : chr "setosa" "setosa" "setosa" "setosa" ...## $ Sepal.Length: num 4.75 5.07 5.24 5.48 4.9 ...## $ Sepal.Width : num 3.3 3.68 3.44 3.96 2.81 ...## $ Petal.Length: num 1.44 1.21 1.59 1.53 1.49 ...## $ Petal.Width : num 0.235 0.111 0.405 0.272 0.345 ...summary(iris_data)## id Species Sepal.Length Sepal.Width## Length:300 Length:300 Min. :4.417 Min. :1.796 ## Class :character Class :character 1st Qu.:5.209 1st Qu.:2.720 ## Mode :character Mode :character Median :5.844 Median :2.992 ## Mean :5.857 Mean :3.064 ## 3rd Qu.:6.448 3rd Qu.:3.375 ## Max. :8.478 Max. :4.810 ## Petal.Length Petal.Width ## Min. :1.135 Min. :-0.03371 ## 1st Qu.:1.566 1st Qu.: 0.30278 ## Median :4.228 Median : 1.28776 ## Mean :3.738 Mean : 1.19830 ## 3rd Qu.:5.205 3rd Qu.: 1.87452 ## Max. :6.955 Max. : 2.62487table(iris_data$Species)## ## setosa versicolor virginica ## 100 100 100hist(iris_data[iris_data$Species=="setosa",]$Sepal.Length, main="SepalLength of Setosa", xlab ="Length", ylab="Frequency", border="red", col="green", breaks=50)
hist(iris_data[iris_data$Species=="versicolor",]$Sepal.Length, main="Sepal Length of Versicolor", xlab ="Length", ylab="Frequency", border="blue", col="yellow", breaks=50)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture