Lab 3.1: Make a plot

Presentation
seth-fulfer-jbu

Mapping

library(datasetsICR)
data("seeds")
library(ggplot2)
plot <- ggplot(data = seeds, mapping = aes(x = area, y = perimeter))

Building The Plot

plot + geom_point() + geom_smooth()

Mapping Aesthetics

plot + geom_point(mapping = aes(color = variety), size = 2) + geom_smooth(color = "black", method = "lm")

Cleaning Labels

plot + geom_point(mapping = aes(color = variety), size = 2) + geom_smooth(color = "black", method = "lm") +
  labs( x = "Area (square millimeters)", y = "Perimeter (millimeters)", 
  title = "Wheat Seed Size By Variety", subtitle = "One data point is a seed",caption = "Source: datasetsICR v1.0")

Final Plot

Final_Plot

Insights

  • Seed variety from smallest to largest: Canadian, Kama, Rosa
  • Correlation between seed area and perimeter is positive and strong