{"id":13948888,"url":"https://github.com/cortinah/hockeystick","last_synced_at":"2025-03-06T14:22:43.485Z","repository":{"id":47688875,"uuid":"282711289","full_name":"cortinah/hockeystick","owner":"cortinah","description":"Download and Visualize Essential Global Heating Data in R","archived":false,"fork":false,"pushed_at":"2024-09-06T21:28:49.000Z","size":78937,"stargazers_count":51,"open_issues_count":7,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T19:41:47.540Z","etag":null,"topics":["carbon","carbon-dioxide-data","carbon-emissions","climate","climate-change","climate-data","climate-science","ggplot2","methane","noaa","r","rstats","sea-ice","sea-levels","temperature-data","warming-stripes"],"latest_commit_sha":null,"homepage":"https://cortinah.github.io/hockeystick/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cortinah.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-26T18:39:59.000Z","updated_at":"2024-10-28T05:45:07.000Z","dependencies_parsed_at":"2023-09-21T19:28:06.345Z","dependency_job_id":"c8ff5090-1ab8-4842-a0f9-3f06176edb97","html_url":"https://github.com/cortinah/hockeystick","commit_stats":{"total_commits":162,"total_committers":2,"mean_commits":81.0,"dds":"0.22839506172839508","last_synced_commit":"f2cb5c85fc6f18aa4f9e3a55a554594f8de19044"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortinah%2Fhockeystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortinah%2Fhockeystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortinah%2Fhockeystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortinah%2Fhockeystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cortinah","download_url":"https://codeload.github.com/cortinah/hockeystick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234205165,"owners_count":18796056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carbon","carbon-dioxide-data","carbon-emissions","climate","climate-change","climate-data","climate-science","ggplot2","methane","noaa","r","rstats","sea-ice","sea-levels","temperature-data","warming-stripes"],"created_at":"2024-08-08T05:01:33.540Z","updated_at":"2025-01-21T14:10:10.041Z","avatar_url":"https://github.com/cortinah.png","language":"R","funding_links":[],"categories":["Climate Change"],"sub_categories":["Climate Data Access and Visualization"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# hockeystick \u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n![R-CMD-check](https://github.com/cortinah/hockeystick/workflows/R-CMD-check/badge.svg)\n[![CRAN status](https://www.r-pkg.org/badges/version/hockeystick)](https://CRAN.R-project.org/package=hockeystick)\n[![](https://cranlogs.r-pkg.org/badges/hockeystick)](https://cran.r-project.org/package=hockeystick)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of `hockeystick` is to make essential Global Heating datasets easily available in R to non-climate experts. `hockeystick` users can download the latest raw data from authoritative sources as well as view it via pre-defined ggplot2 charts. Datasets include atmospheric CO\u003csub\u003e2\u003c/sub\u003e and CH\u003csub\u003e4\u003c/sub\u003e, carbon emissions, instrumental, reconstructed, and paleo ice-core temperature records, sea levels, hurricanes, and Arctic/Antarctic sea-ice.\n\nThe choice of data was originally based on [Professor Stefan Rahmstorf's ](http://www.pik-potsdam.de/~stefan/) presentation on [The 5 Most Important Data Sets of Climate Science](http://www.pik-potsdam.de/~stefan/5datasets_rahmstorf.pdf). I came across this on a post on the [Open Mind blog](https://tamino.wordpress.com/2018/11/01/the-5-most-important-data-sets-of-climate-science/). I wrote my own [post](https://rethinking.rbind.io/2018/11/16/the-top-five-climate-charts-using-ggplot2/) on obtaining and visualizing this data (now out of date), which is the basis for this package. Additional datasets and visualizations have been added over  The name of the package stems from the well known [hockeystick](https://en.wikipedia.org/wiki/Hockey_stick_graph) temperature chart. \n\n`hockeystick` was highlighted on the RStudio [RViews](https://rviews.rstudio.com/2021/03/19/february-2021-top-40-new-cran-packages/) blog by Joseph Rickert as one of the \"Top 40\" new packages on CRAN in February 2021.\n\n**New in version 0.8.0:** Daily temperature data from ClimateReanalyzer.com (see below).\n\nNew in version 0.7.0: Globally averaged methane (CH~4~) concentration from NOAA.\n\nNew in version 0.7.0: Cumulative emissions by country visualization.\n\nNew in version 0.6.0: Global CO~2~ emissions by region and country from GCP.\n\n## Installation\nTo install the latest `hockeystick` release from CRAN type:\n\n``` r\ninstall.packages(\"hockeystick\")\n```\n\n\nYou may alternatively install the development version from [https://github.com/cortinah/hockeystick](https://github.com/cortinah/hockeystick) with:\n  \n``` r\nremotes::install_github(\"cortinah/hockeystick\")\n```\n\n## Downloading and viewing global heating data\n\nNew: Plot daily global temperatures since 1940 and current anomaly:\n\n```{r dailytemp, fig.retina=2, message=FALSE, out.width='60%', fig.asp=1.03}\nlibrary(hockeystick)\nglobaldaily \u003c- get_dailytemp()\nplot_dailytemp(globaldaily)\n```\n\nRetrieve NOAA/ESRL Mauna Loa CO\u003csub\u003e2\u003c/sub\u003e Observatory concentration data and plot:\n\n```{r carbon, fig.retina=2, message=FALSE, out.width='60%'}\nml_co2 \u003c- get_carbon()\nplot_carbon(ml_co2)\n```\n\nRetrieve GCP global CO~2~ emissions and plot:\n\n```{r emissions, out.width='65%', fig.retina=2, message=FALSE}\nemissions \u003c- get_emissions()\nplot_emissions(emissions)\nplot_emissions_with_land(emissions)\n```\n\nVisualize cumulative emissions by country:\n```{r emissionsmap, out.width='60%', fig.retina=2}\nemissions_map()\n```\n\nRetrieve NASA/GISS global surface temperature anomaly data and plot:\n\n```{r temp, out.width='60%', fig.retina=2}\nanomaly \u003c- get_temp()\nplot_temp(anomaly)\n```\n\nPlot relationship between temperature anomaly and carbon:\n```{r tempcarbon, out.width='60%', fig.retina=2}\nplot_carbontemp()\n```\n\nVisualize warming using Ed Hawkins styled \"warming stripes\":\n```{r stripes, out.width='60%', fig.retina=2}\nwarming_stripes()\n```\n```{r stripes2, out.width='53%', fig.retina=2}\nwarming_stripes(stripe_only = TRUE, col_strip = viridisLite::viridis(11))\n```\n\nRetrieve tide gauge and satellite sea level data and plot:\n\n```{r sl, out.width='60%', fig.retina=2}\ngmsl \u003c- get_sealevel()\nplot_sealevel(gmsl)\n```\n\nRetrieve July annual Arctic Sea Ice Index and plot:\n\n```{r si, fig.retina=2, message=FALSE, out.width='60%', warning=FALSE}\nseaice \u003c- get_seaice()\nplot_seaice(seaice)\n```\n\n`get_seaice()` arguments can be modified to download Antarctic sea ice, and allow any month.\n\nYou can also visualize sea ice by month and year:\n\n```{r icecurves, fig.retina=2, message=FALSE, out.width='60%'}\narcticice \u003c- get_icecurves()\nplot_icecurves(arcticice)\n```\n\nRetrieve Common Era temperature reconstruction and plot it with instrumental record:\n\n```{r 2ktemp, out.width='60%', fig.retina=2}\nanomaly2k \u003c- get_temp2k()\nplot_temp2k(anomaly2k)\n```\n\nRetrieve NOAA HURDAT2 hurricane data and plot:\n\n```{r hurricanes, out.width='60%', fig.retina=2, message=FALSE}\nhurricanes \u003c- get_hurricanes()\nplot_hurricanes(hurricanes)\nplot_hurricane_nrg(hurricanes)\n```\n\nRetrieve NOAA/ESRL CH\u003csub\u003e4\u003c/sub\u003e Globally averaged mean data and plot:\n\n```{r methane, fig.retina=2, message=FALSE, out.width='60%'}\nch4 \u003c- get_methane()\nplot_methane(ch4)\n```\n\nRetrieve Vostok paleo ice core data and plot:\n\n```{r paleo, out.width='60%', fig.retina=2, message=FALSE}\nvostok \u003c- get_paleo()\nplot_paleo(vostok)\n```\n\n### Managing the cache\nBy default, no climate data is cached, and all data is downloaded every time any of the `get_` functions is called. To cache data for future use, use the `write_cache = TRUE` option, available in all of the `get_` functions. To download and cache all data use `hockeystick_update_all()`. To view the files, date, and size of cached data use `hockeystick_cache_details()`.  To re-download data from the source use the `use_cache = FALSE` argument in any of the `get_` functions, for example: `get_carbon(use_cache = FALSE, write_cache = TRUE)`.  To delete all cached data use `hockeystick_cache_delete_all()`.\n\nUsers may also cache data by default by adding `options(hs_write_cache = TRUE)`to their script or `.Rprofile` file.\n\n### All together now: climate data grid\n```{r grid, out.width='80%', fig.retina=2, warning=FALSE}\nclimate_grid()\n```\n\n## Acknowledgments\n- Carbon Dioxide concentrations: Dr. Pieter Tans, NOAA/GML (https://gml.noaa.gov/ccgg/trends/) and Dr. Ralph Keeling, [Scripps Institution of Oceanography](https://scrippsco2.ucsd.edu/).\n- Global temperature anomaly: *GISS Surface Temperature Analysis (GISTEMP), version 4.* GISTEMP Team, 2020: NASA Goddard Institute for Space Studies. https://data.giss.nasa.gov/gistemp/\n- Warming Stripes design from Ed Hawkins' Climate Lab. https://www.climate-lab-book.ac.uk/2018/warming-stripes/. In addition grateful to Dr. Dominic Royé for posting his approach to plotting them using ggplot2, which `warming_stripes()` is based on. https://dominicroye.github.io/en/2018/how-to-create-warming-stripes-in-r/\n- Sea level data: [NOAA Laboratory for Satellite Altimetry (sat)](https://www.star.nesdis.noaa.gov/socd/lsa/SeaLevelRise/) and [Commonwealth Scientific and Industrial Research Organisation (tide gauges)](https://research.csiro.au/slrwavescoast/sea-level/measurements-and-data/sea-level-data/)\n- Sea Ice Index: [National Snow \u0026 Ice Data Center](https://nsidc.org/home).\nData Archive: https://nsidc.org/data/explore-data\n- Vostok carbon dioxide and temperature data: https://data.ess-dive.lbl.gov/datasets/doi:10.3334/CDIAC/ATG.009\n- Common Era reconstructed temperature data: [PAGES2k Consortium and NOAA](https://www.ncei.noaa.gov/access/paleo-search/study/26872)). \n- Hurricanes: National Oceanic and Atmospheric Administration HURDAT Atlantic Hurricane Database [Re-analysis Project](https://www.aoml.noaa.gov/hrd/hurdat/Data_Storm.html), particularly Dr. Chris Landsea.\n- Carbon Dioxide emissions: [Global Carbon Project](https://www.globalcarbonproject.org/carbonbudget/) and [Our World In Data](https://github.com/owid/co2-data)\n- Methane: Lan, X., K.W. Thoning, and E.J. Dlugokencky, NOAA Global Monitoring Laboratory (https://gml.noaa.gov/ccgg/trends_ch4/).\n- Thank you to Dirk Eddelbuettel for providing the .isConnected function from his [tint](https://CRAN.R-project.org/package=tint) package to test for internet connectivity.\n- Thank you to Chris Campbell and Steven Bernard of the FT Climate Graphics Explained newsletter for sharing their code for climatereanalyzer.org daily temperature chart (Temperature Records Broken...Again, 9 July 2023). This code is the foundation of the get_dailytemp() and plot_dailytemp() functions.\n\n## Notes and resources\n- All data is compiled to the best of my ability from reliable and peer-reviewed sources. Please open an issue if you are aware of enhanced or additional data that may be added to the package. Building `hockeystick` is driven by my interest in tracking climate data and making it easily available to the community.\n- Here are some online resources I have found very helpful to learn mo    re about climate science:\n- MIT edX Global Warming Science. https://www.edx.org/learn/global-warming/massachusetts-institute-of-technology-global-warming-science\n- SDG Academy: Climate Change: The Science and Global Impact. https://sdgacademy.org/course/climate-change-the-science-and-global-impact/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortinah%2Fhockeystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcortinah%2Fhockeystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortinah%2Fhockeystick/lists"}