This page was made for the purposes of an assignment in a geography class. It uses the iris.csv file (Fisher’s iris dataset).
Hello, and welcome to the markdown report version of Exercise 1! To start, we will need to begin by opening the iris.csv file. The variable ‘iris’ was created to easily assign it to other parts of the code.
iris = read.csv("iris.csv")
Next, let’s do some summary statistics. The average, standard deviation, and range of the sepal width have been calculated below. Note: Some parts of the original code have been modified for neatness.
print(mean(iris$Sepal.Width))
## [1] 3.057333
print(sd(iris$Sepal.Width))
## [1] 0.4358663
print(range(iris$Sepal.Width))
## [1] 2.0 4.4
Our next task is to create a plot of the petal values. The petal length is used as the independent variable and the petal width as the dependent variable.
plot(iris$Petal.Length, iris$Petal.Width, pch=16, xlab = "Petal Length", ylab = "Petal Width", col=as.factor(iris$Species))
Finally, the last job to do is to estimate the petal area and save a new csv file. Note: Check the file directory where you saved this markdown file to find the new csv.
iris$Petal.Area = pi * iris$Petal.Length * iris$Petal.Width
write.csv(iris, "iris2.csv", row.names = FALSE)
Done! Thank you for viewing my report!