April 2018
Beginner
238 pages
7h 13m
English
We can use this script:
# load the iris datasetdata <- read.csv("http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data")#Let us also clean up the data so as to be more readablecolnames(data) <- c("sepal_length", "sepal_width", "petal_length", "petal_width", "species")# call plot firstplot(data$sepal_length, data$petal_length)# abline adds to the plotabline(lm(data$petal_length ~ sepal_length), col="red")
It results in a similar Scatter plot but with a regression line included:
