Plots the Sea Ice Index data retrieved using get_seaice() with ggplot2. The output ggplot2 object may be further modified.

plot_seaice(dataset = get_seaice(), title = "Arctic Sea Ice", print = TRUE)

Arguments

dataset

Name of the tibble generated by get_seaice, defaults to calling get_seaice

title

chart title, defaults to Arctic Sea Ice

print

(boolean) Display sea ice ggplot2 chart, defaults to TRUE. Use FALSE to not display chart.

Value

Invisibly returns a ggplot2 object with Sea Ice Index chart

Details

plot_seaice invisibly returns a ggplot2 object with a pre-defined Sea Ice Index chart using data from get_seaice. By default the chart is also displayed. Users may further modify the output ggplot2 chart.

Author

Hernando Cortina, hch@alum.mit.edu

Examples

# \donttest{ # Fetch sea ice data: seaice <- get_seaice()
#> Please set use_cache=FALSE if you are changing pole, month, or measure from last cached data.
# # Plot output using package's built-in ggplot2 defaults plot_seaice(seaice)
#> Warning: Removed 1 rows containing missing values (geom_smooth).
# Or just call plot_seaice(), which defaults to get_seaice() dataset plot_seaice()
#> Please set use_cache=FALSE if you are changing pole, month, or measure from last cached data.
#> Warning: Removed 1 rows containing missing values (geom_smooth).
p <- plot_seaice(seaice, print = FALSE) p + ggplot2::labs(title='Shrinking Arctic Sea Ice') # }
#> `geom_smooth()` using formula 'y ~ x'
#> Warning: Removed 1 rows containing missing values (geom_smooth).