plot_methane {hockeystick}R Documentation

Download and plot essential climate data

Description

Plots atmospheric methane data retrieved using get_methane() with ggplot2. The output ggplot2 object may be modified.

Usage

plot_methane(dataset = get_methane(), print = TRUE, annot = TRUE)

Arguments

dataset

Name of the tibble generated by get_methane

print

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

annot

(boolean) Include chart annotation with latest date and value, defaults to TRUE.

Details

plot_methane invisibly returns a ggplot2 object with a pre-defined methane chart using data from get_methane. By default the chart is also displayed. Users may further modify the output ggplot2 chart.

Value

Invisibly returns a ggplot2 object with methane chart

Author(s)

Hernando Cortina, hch@alum.mit.edu

Examples


# Fetch methane data:
ch4 <- get_methane()
#
# Plot output using package's built-in ggplot2 defaults
plot_methane(ch4)

# Or just call plot_methane(), which defaults to get_methane() dataset
plot_methane()

p <- plot_methane(ch4, print = FALSE)
# Modify plot such as: p + ggplot2::labs(title='Trend in Atmospheric Methane') 


[Package hockeystick version 0.8.4 Index]