- Packages I will use to read in and plot the data
- Read the data in from part 1
regional_anomaly <- read_csv(here::here("_posts", "2022-05-09-project-part-1","regional_anomaly.csv"))
Interactive graph
- Start with data
- Use e_charts to create an _charts object with Year on the x axis-
- Use e_line to show climate_change by region. Each line represents the amount of temperature anomaly for each region.
- Use e_tooltip to add a tooltip that will display based on the axis values
- Use _title to add a title, subtitle, and link to subtitle-
- Use e_theme to change the theme to roma
Static graph
- Start with the data-
- Use ggplot to create a new ggplot object. Use aes to indicate that Date will be mapped to the x axis; temperature anomaly will be mapped to the y axis; Region will be the fill variable
- geom_line will display temperature anomaly.
- theme_classic sets the theme
- theme(legend.position = “bottom”) puts the legend at the bottom of the plot
- labs sets the y axis label, fill = NULL indicates that the fill variable will not have the labelled Region
These plots show a constant increase in temperature anomaly
ggsave(filename = here::here("_posts", "2022-05-13-project-part-2", "preview.png"))