setwd("C:/Users/Sam/Documents/DSCI_605/Module_4/")
#library(help = "datasets")
library(stats)
Choose a different built in dataset in R or packages
t <- trees
t <- subset(t, select = -c(Volume))
Change the point size, style, and colors. Also change font and size of title/axis.
plot(t$Girth, t$Height, pch = 6, cex = 2, col = "red", main = "Tree Height And Girth", xlab = "Tree Girth",
ylab = "Tree Height", cex.main = 4, cex.lab = 1.5, font.main = 6, font.lab = 4, col.main = "blue", col.lab = "yellow")
# Now add lines and legends.
lines(lowess(t$Girth, t$Height), col = 3, lty = 5)
lines(lowess(t$Girth, t$Height, f=.01), col = 6, lty = 5)
legend(x = "topleft", c(paste("f =", c(".2/3", ".01"))), lty = 5, col = 3:6)
