Retrieves atmospheric carbon dioxide measurements from National Oceanic and Atmospheric Administration Earth System Research Laboratories monitoring laboratory in Mauna Loa, Hawaii. https://gml.noaa.gov/ccgg/trends/data.html

get_carbon(use_cache = TRUE, write_cache = getOption("hs_write_cache"))

Arguments

use_cache

(boolean) Return cached data if available, defaults to TRUE. Use FALSE to fetch updated data.

write_cache

(boolean) Write data to cache, defaults to FALSE. Use TRUE to write data to cache for later use. Can also be set using options(hs_write_cache=TRUE)

Value

Invisibly returns a tibble with the monthly carbon dioxide series

Details

get_carbon invisibly returns a tibble with NOAA's monthly average carbon dioxide measurement. The returned object includes date, year, month, average, trend, std dev, and uncertainty columns. Trend is NOAA's published trend. Please refer to above website for details.

References

Dr. Pieter Tans, NOAA/GML https://gml.noaa.gov/ccgg/trends/ and Dr. Ralph Keeling, Scripps Institution of Oceanography https://scrippsco2.ucsd.edu/.

C.D. Keeling, R.B. Bacastow, A.E. Bainbridge, C.A. Ekdahl, P.R. Guenther, and L.S. Waterman, (1976), Atmospheric carbon dioxide variations at Mauna Loa Observatory, Hawaii, Tellus, vol. 28, 538-551

Author

Hernando Cortina, hch@alum.mit.edu

Examples

# \donttest{ # Fetch from cache if available: maunaloa <- get_carbon() # # Force cache refresh: maunaloa <- get_carbon(use_cache=FALSE)
#> Warning: InternetOpenUrl failed: 'The server name or address could not be resolved #> '
#> Error in download.file(file_url, dl): cannot open URL 'ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_mm_mlo.txt'
# # Review cache contents and last update dates: hockeystick_cache_details()
#> <hockeystick cached files> #> directory: C:\Users\hch\AppData\Local/R/cache/R/hockeystick #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/emissions.rds #> size: 1699.5 kB #> date: 2021-06-13 00:11:14 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/gisstemp.rds #> size: 5.3 kB #> date: 2021-06-13 00:10:57 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/hurricanes.rds #> size: 1.6 kB #> date: 2021-06-13 00:11:12 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/maunaloa.rds #> size: 9.5 kB #> date: 2021-06-13 00:10:56 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/seaice.rds #> size: 0.5 kB #> date: 2021-06-13 00:10:57 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/sealevel.rds #> size: 16.1 kB #> date: 2021-06-13 00:11:03 #> #> file: C:\Users\hch\AppData\Local/R/cache/R/hockeystick/temp2k.rds #> size: 21.8 kB #> date: 2021-06-13 00:11:12 #>
# # Plot output using package's built-in ggplot2 settings plot_carbon(maunaloa) # }