hockeystick
Download and Visualize Essential Global Heating Data in R
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
2 of 2 committers (100.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.5%) to scientific vocabulary
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
Last synced: 5 months ago
·
JSON representation
Repository
Download and Visualize Essential Global Heating Data in R
Basic Info
- Host: GitHub
- Owner: cortinah
- License: other
- Language: R
- Default Branch: main
- Homepage: https://cortinah.github.io/hockeystick/
- Size: 91.9 MB
Statistics
- Stars: 50
- Watchers: 3
- Forks: 4
- Open Issues: 8
- Releases: 14
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
Created over 5 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include=FALSE}
knitr::knit_hooks$set(pngquant = knitr::hook_pngquant)
knitr::opts_chunk$set(
message = FALSE,
fig.path = "man/figures/README-",
collapse = TRUE,
comment = "#>",
dev = "ragg_png",
dpi = 72,
fig.retina = 2,
pngquant = "--speed=1 --quality=50"
)
```
# hockeystick
[](https://lifecycle.r-lib.org/articles/stages.html#stable)

[](https://CRAN.R-project.org/package=hockeystick)
[](https://cran.r-project.org/package=hockeystick)
The 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 CO2 and CH4, carbon emissions, instrumental, reconstructed, and paleo ice-core temperature records, sea levels, hurricanes, and Arctic/Antarctic sea-ice.
The 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.
`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.
**New in version 0.8.0:** Daily temperature data from ClimateReanalyzer.com (see below).
New in version 0.7.0: Globally averaged methane (CH~4~) concentration from NOAA.
New in version 0.7.0: Cumulative emissions by country visualization.
New in version 0.6.0: Global CO~2~ emissions by region and country from GCP.
## Installation
To install the latest `hockeystick` release from CRAN type:
``` r
install.packages("hockeystick")
```
You may alternatively install the development version from [https://github.com/cortinah/hockeystick](https://github.com/cortinah/hockeystick) with:
``` r
remotes::install_github("cortinah/hockeystick@testing")
```
## Downloading and viewing global heating data
Plot daily global temperatures since 1940 and current anomaly:
```{r dailytemp, fig.retina=2, message=FALSE, out.width='60%', fig.asp=1.03}
library(hockeystick)
globaldaily <- get_dailytemp()
plot_dailytemp(globaldaily)
```
Retrieve NOAA/ESRL Mauna Loa CO2 Observatory concentration data and plot:
```{r carbon, fig.retina=2, message=FALSE, out.width='60%'}
ml_co2 <- get_carbon()
plot_carbon(ml_co2)
```
Retrieve GCP global CO~2~ emissions and plot:
```{r emissions, out.width='60%', fig.retina=2, message=FALSE}
emissions <- get_emissions()
plot_emissions(emissions)
plot_emissions_with_land(emissions)
```
Visualize cumulative emissions by country:
```{r emissionsmap, out.width='60%', fig.retina=2}
emissions_map()
```
Retrieve NASA/GISS global surface temperature anomaly data and plot:
```{r temp, out.width='60%', fig.retina=2}
anomaly <- get_temp()
plot_temp(anomaly)
```
Plot relationship between temperature anomaly and carbon:
```{r tempcarbon, out.width='60%', fig.retina=2}
plot_carbontemp()
```
Visualize warming using Ed Hawkins styled "warming stripes":
```{r stripes, out.width='60%', fig.retina=2}
warming_stripes()
```
```{r stripes2, out.width='60%', fig.retina=2}
warming_stripes(stripe_only = TRUE, col_strip = viridisLite::viridis(11))
```
Retrieve tide gauge and satellite sea level data and plot:
```{r sl, out.width='60%', fig.retina=2}
gmsl <- get_sealevel()
plot_sealevel(gmsl)
```
Retrieve July annual Arctic Sea Ice Index and plot:
```{r si, fig.retina=2, message=FALSE, out.width='60%', warning=FALSE}
seaice <- get_seaice()
plot_seaice(seaice)
```
`get_seaice()` arguments can be modified to download Antarctic sea ice, and allow any month.
You can also visualize sea ice by month and year:
```{r icecurves, fig.retina=2, message=FALSE, out.width='60%'}
arcticice <- get_icecurves()
plot_icecurves(arcticice)
```
Retrieve Common Era temperature reconstruction and plot it with instrumental record:
```{r 2ktemp, out.width='60%', fig.retina=2}
anomaly2k <- get_temp2k()
plot_temp2k(anomaly2k)
```
Retrieve NOAA HURDAT2 hurricane data and plot:
```{r hurricanes, out.width='60%', fig.retina=2, message=FALSE}
hurricanes <- get_hurricanes()
plot_hurricanes(hurricanes)
plot_hurricane_nrg(hurricanes)
```
Retrieve NOAA/ESRL CH4 Globally averaged mean data and plot:
```{r methane, fig.retina=2, message=FALSE, out.width='60%'}
ch4 <- get_methane()
plot_methane(ch4)
```
Retrieve Vostok paleo ice core data and plot:
```{r paleo, out.width='60%', fig.retina=2, message=FALSE}
vostok <- get_paleo()
plot_paleo(vostok)
```
### Managing the cache
By 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()`.
Users may also cache data by default by adding `options(hs_write_cache = TRUE)`to their script or `.Rprofile` file.
### All together now: climate data grid
```{r grid, out.width='80%', fig.retina=2, warning=FALSE}
climate_grid()
```
## Acknowledgments
- 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/).
- 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/
- 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/
- 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/)
- Sea Ice Index: [National Snow & Ice Data Center](https://nsidc.org/home).
Data Archive: https://nsidc.org/data/explore-data
- Vostok carbon dioxide and temperature data: https://data.ess-dive.lbl.gov/datasets/doi:10.3334/CDIAC/ATG.009
- Common Era reconstructed temperature data: [PAGES2k Consortium and NOAA](https://www.ncei.noaa.gov/access/paleo-search/study/26872)).
- 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.
- Carbon Dioxide emissions: [Global Carbon Project](https://www.globalcarbonproject.org/carbonbudget/) and [Our World In Data](https://github.com/owid/co2-data)
- Methane: Lan, X., K.W. Thoning, and E.J. Dlugokencky, NOAA Global Monitoring Laboratory (https://gml.noaa.gov/ccgg/trends_ch4/).
- 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.
- 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.
- Thank you Nan Xiao for [PNG compression approach](https://nanx.me/blog/post/rpkgs-pngquant-ragg/).
## Notes and resources
- 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.
- Here are some online resources I have found very helpful to learn mo re about climate science:
- MIT edX Global Warming Science. https://www.edx.org/learn/global-warming/massachusetts-institute-of-technology-global-warming-science
- SDG Academy: Climate Change: The Science and Global Impact. https://sdgacademy.org/course/climate-change-the-science-and-global-impact/
Owner
- Name: Hernando Cortina
- Login: cortinah
- Kind: user
- Location: New York, NY
- Twitter: cortinah
- Repositories: 35
- Profile: https://github.com/cortinah
Views are my own and do not necessarily represent the position, strategy, or opinions of my employer.
GitHub Events
Total
- Issues event: 1
- Watch event: 3
- Delete event: 6
- Push event: 81
- Pull request event: 3
- Create event: 3
Last Year
- Issues event: 1
- Watch event: 3
- Delete event: 6
- Push event: 81
- Pull request event: 3
- Create event: 3
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Hernando | h****h@a****u | 127 |
| Hernando | h****h@a****u | 37 |
Committer Domains (Top 20 + Academic)
alum.mit,edu: 1
alum.mit.edu: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 12
- Total pull requests: 20
- Average time to close issues: 4 months
- Average time to close pull requests: 8 minutes
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 19
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cortinah (11)
- carbonmetrics (1)
Pull Request Authors
- cortinah (21)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 454 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 29
- Total maintainers: 1
proxy.golang.org: github.com/cortinah/hockeystick
- Documentation: https://pkg.go.dev/github.com/cortinah/hockeystick#section-documentation
- License: other
-
Latest release: v0.8.5
published about 1 year ago
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced:
6 months ago
cran.r-project.org: hockeystick
Download and Visualize Essential Climate Change Data
- Homepage: https://cortinah.github.io/hockeystick/
- Documentation: http://cran.r-project.org/web/packages/hockeystick/hockeystick.pdf
- License: MIT + file LICENSE
-
Latest release: 0.8.6
published 6 months ago
Rankings
Stargazers count: 7.1%
Forks count: 12.3%
Average: 18.6%
Downloads: 21.5%
Dependent repos count: 24.3%
Dependent packages count: 27.9%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.0.0 depends
- dplyr * imports
- ggplot2 * imports
- lubridate * imports
- patchwork * imports
- readr * imports
- rvest * imports
- scales * imports
- tibble * imports
- tidyr * imports
- tools * imports
- knitr * suggests
- rmarkdown * suggests
- spelling * suggests
- viridisLite * suggests
.github/workflows/check-standard.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite