Plots the Vostok ice core data retrieved using get_paleo() with ggplot2. The output ggplot2 object may be further modified.

plot_paleo(dataset = get_paleo(), print = TRUE)

Arguments

dataset

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

print

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

Value

Invisibly returns a ggplot2 object with the Vostok chart

Details

plot_paleo invisibly returns a ggplot2 object with a pre-defined Vostok ice core chart using data from get_paleo. The returned chart stacks carbon dioxide concentration over temperature over 420,000 years. By default the chart is also displayed. Users may further modify the output ggplot2 chart.

References

Barnola, J.-M., D. Raynaud, C. Lorius, and N.I. Barkov. 2003. Historical CO2 record from the Vostok ice core. In Trends: A Compendium of Data on Global Change. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tenn., U.S.A

Author

Hernando Cortina, hch@alum.mit.edu

Examples

# \donttest{ # Fetch Vostok data: vostok <- get_paleo()
#> Warning: InternetOpenUrl failed: 'The server name or address could not be resolved'
#> Error in download.file(file_url, dl): cannot open URL 'http://cdiac.ess-dive.lbl.gov/ftp/trends/co2/vostok.icecore.co2'
# # Plot output using package's built-in ggplot2 defaults plot_paleo(vostok)
#> Error in ggplot(dataset[dataset$name == "co2", ], aes(x = age_ice, y = value)): object 'vostok' not found
# Or just call plot_paleo(), which defaults to get_paleo() dataset plot_paleo()
#> Warning: InternetOpenUrl failed: 'The server name or address could not be resolved'
#> Error in download.file(file_url, dl): cannot open URL 'http://cdiac.ess-dive.lbl.gov/ftp/trends/co2/vostok.icecore.co2'
p <- plot_paleo(vostok, print = FALSE)
#> Error in ggplot(dataset[dataset$name == "co2", ], aes(x = age_ice, y = value)): object 'vostok' not found
p + patchwork::plot_annotation(title='A Long History of Carbon') # }
#> Error in eval(expr, envir, enclos): object 'p' not found