The “macleish” package contains weather data collected every ten minutes in 2015 from two weather stations in Whately, MA. Using ggpplot2, create a data graphic that displays the average temperature over each 10-minute interal (temperature) as a function of time (when).
library(macleish) # package contains weather data
library(ggplot2)
data(whately_2015)
ggplot(data = whately_2015, aes(x = when, y = temperature)) +
geom_line()
Using data from the “nasaweather” package, create a scatterplot between wind and pressure, with color being used to distinguish the type of storm.
library(nasaweather) # package contains storms data
data(storms)
ggplot(data = storms, aes(x = wind, y = pressure, color = type)) +
geom_point()
Using data from the nasaweather package, use the geom_path() function to plot the path of each tropical storm in the storms data table. Use color to distinguish the storms from one another, and use facetting to plot each year in its own panel.
ggplot(data = storms, aes(x = lat, y = long, color = type)) +
geom_path() +
geom_point() +
facet_wrap(~ year)