data("iris")
str(iris)
## 'data.frame': 150 obs. of 5 variables:
## $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
## $ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
## $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
## $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
## $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
par(mfrow=c(3,2), bg="#229955")
# Plot Sepal width against serial number
plot(iris$Sepal.Width, xlab="serial number", ylab="sepal width", main = "Sepal width - 21MIC0065")
# Create a horizontal bar plot of Petal width
barplot(iris$Petal.Width, xlab="Petal width", main="Barplot of Petal width - 21MIC0065", horiz = TRUE)
# Plot Sepal Width against Sepal Length
plot(iris$Sepal.Width, iris$Sepal.Length, xlab="Sepal width", ylab="Sepal length", main="Sepal Width vs. Sepal Length Plot - 21MIC0065")
# Create a vertical bar plot of Sepal Length
barplot(iris$Sepal.Length, xlab="Sepal length", ylab = "Range", main="Barplot of Sepal Length - 21MIC0065")
# Create a boxplot of Sepal length
boxplot(iris$Sepal.Length, xlab="Sepal length", ylab="Range", main="Sepal length Boxplot - 21MIC0065")
# Create a boxplot of Sepal Width, Petal Length, and Petal Width
boxplot(iris[,2:4], main="Boxplot of Sepal Width, Petal Length, and Petal Width - 21MIC0065")
