Skip to contents

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.

Value

Invisibly returns a ggplot2 object with methane chart

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.

Author

Hernando Cortina, hch@alum.mit.edu

Examples

# \donttest{
# 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') # }