{"id":32440343,"url":"https://github.com/patrickbarks/cantempr","last_synced_at":"2026-07-13T05:01:58.322Z","repository":{"id":96005128,"uuid":"164923697","full_name":"patrickbarks/cantempr","owner":"patrickbarks","description":"R package to access long-term homogenized temperature data for 338 Canadian climate stations","archived":false,"fork":false,"pushed_at":"2019-01-10T11:47:05.000Z","size":864,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T01:27:59.668Z","etag":null,"topics":["climate-data","r","rstats","temperature-data"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickbarks.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-01-09T19:21:00.000Z","updated_at":"2019-09-20T07:29:56.000Z","dependencies_parsed_at":"2023-03-29T00:19:47.722Z","dependency_job_id":null,"html_url":"https://github.com/patrickbarks/cantempr","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"c049c8361d0718a5bc0b77e566e331eec818965f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrickbarks/cantempr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbarks%2Fcantempr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbarks%2Fcantempr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbarks%2Fcantempr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbarks%2Fcantempr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickbarks","download_url":"https://codeload.github.com/patrickbarks/cantempr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbarks%2Fcantempr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35410672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["climate-data","r","rstats","temperature-data"],"created_at":"2025-10-26T01:27:36.486Z","updated_at":"2026-07-13T05:01:58.315Z","avatar_url":"https://github.com/patrickbarks.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  eval = TRUE,\n  fig.path = \"man/img/\"\n)\noptions(digits = 4)\n```\n\n# cantempr\n\n[![Travis build status](https://travis-ci.org/patrickbarks/cantempr.svg?branch=master)](https://travis-ci.org/patrickbarks/cantempr) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/patrickbarks/cantempr?branch=master\u0026svg=true)](https://ci.appveyor.com/project/patrickbarks/cantempr) [![Coverage status](https://codecov.io/gh/patrickbarks/cantempr/branch/master/graph/badge.svg)](https://codecov.io/github/patrickbarks/cantempr?branch=master)\n\nAn R package to access long-term homogenized temperature data for 338 Canadian climate stations (for some stations data is available as far back as 1841). These data come from [Vincent et al. (2012)](https://doi.org/10.1029/2012JD017859), and are available in station-specific text files from [Environment and Climate Change Canada](https://www.canada.ca/en/environment-climate-change/services/climate-change/science-research-data/climate-trends-variability/adjusted-homogenized-canadian-data/surface-air-temperature-access.html) (see file 'Monthly mean of daily mean temperature').\n\n__Data citation__: Vincent, L. A., X. L. Wang, E. J. Milewska, H. Wan, F. Yang, and V. Swail (2012) A second generation of homogenized Canadian monthly surface air temperature for climate trend analysis. Journal of Geophysical Research 117(D18110). [https://doi.org/10.1029/2012JD017859](https://doi.org/10.1029/2012JD017859)\n\n## Installation\n\nInstall from GitHub with:\n\n```{r, eval=FALSE}\n# first install package 'remotes' if necessary (a dependency of devtools)\n# install.packages(\"remotes\") \nremotes::install_github(\"patrickbarks/cantempr\")\n```\n\n## Usage\n\n```{r}\nlibrary(cantempr)\n```\n\n#### Fetch data\n\nTemperature data can be fetched using the `cantemp_fetch()` function. Temperature data is available at monthly, seasonal, and annual intervals (selected with argument `interval`).\n\n```{r}\ntemp_annual \u003c- cantemp_fetch(interval = \"annual\") # fetch annual data\n```\n\nLet's take a peek.\n\n```{r}\nhead(temp_annual)\n```\n\nWe can also fetch station-specific metadata (including lat/lon/elevation, and details on the temporal extent of the temperature data) using the function `cantemp_meta()`.\n\n```{r}\nstn_metadata \u003c- cantemp_meta()\n```\n\n#### Barcode plot\n\nThe `cantempr` package includes a function to produce 'temperature barcode plots' (see examples [here](https://www.cbc.ca/news/technology/charts-climate-change-bar-codes-1.4802293)). Here's an example barcode plot using a time-series of mean annual temperatures in Toronto, Ontario.\n\n```{r, fig.width=8, fig.height=3}\nlibrary(ggplot2)\n\n# subset annual temperature data to Toronto\ntemp_to \u003c- subset(temp_annual, station == \"TORONTO\")\n\n# create barcode plot\ncantemp_barcode(temp_to, x_breaks = seq(1850, 2010, 20)) +\n  ggtitle(paste(\"Mean annual temperatures in Toronto since\", min(temp_to$year)))\n```\n\n#### Seasonal temperature trends\n\nHere's a more traditional plot of long-term temperature trends, by season, in Hay River, Northwest Territories.\n\n```{r, fig.width=8, fig.height=6}\n# subset to seasonal temperature data for Hay River, Northwest Territories\ntemp_seasonal \u003c- cantemp_fetch(interval = \"seasonal\")\ntemp_hr \u003c- subset(temp_seasonal, station == \"HAY RIVER\" \u0026 !is.na(temp))\n\n# plot\nggplot(temp_hr, aes(year, temp)) +\n  geom_line() +\n  geom_smooth(method = \"loess\") +\n  scale_x_continuous(breaks = seq(1900, 2020, 20)) +\n  scale_y_continuous(labels = function(x) paste0(x, \"\\u00B0C\")) +\n  facet_wrap(~ interval, ncol = 2, scales = \"free_y\") +\n  ggtitle(paste(\"Mean seasonal temperatures in Hay River, NWT, since\", min(temp_hr$year))) +\n  theme_minimal() + theme(axis.title = element_blank())\n```\n\n## Contributions\n\nAll contributions are welcome. Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbarks%2Fcantempr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickbarks%2Fcantempr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbarks%2Fcantempr/lists"}