-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
68 lines (48 loc) · 2.17 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
library(tidyverse)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# rclimateca
[![](http://cranlogs.r-pkg.org/badges/rclimateca)](https://cran.r-project.org/package=rclimateca) [![Travis-CI Build Status](https://travis-ci.org/paleolimbot/rclimateca.svg?branch=master)](https://travis-ci.org/paleolimbot/rclimateca) [![Coverage Status](https://img.shields.io/codecov/c/github/paleolimbot/rclimateca/master.svg)](https://codecov.io/github/paleolimbot/rclimateca?branch=master)
This package is designed to be an R interface to various Environment Canada datasets, including the [historical climate data archive](http://climate.weather.gc.ca/). In the future, the package may also provide access to [hydrometric data](https://wateroffice.ec.gc.ca/) using the same interface (currently in the form of the [hydatr package](https://github.com/paleolimbot/hydatr).
## Installation
You can install rclimateca from CRAN with:
```{r cran-install, eval = FALSE}
install.packages("rclimateca")
```
Or the development version from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("paleolimbot/rclimateca")
```
If you can load the package, everything worked!
```{r}
library(rclimateca)
```
## Example
The workflow for which this **rclimateca** is designed is as follows:
1. Find climate stations using `ec_climate_search_locations()` or `ec_climate_geosearch_locations()`.
2. Download the data using `ec_climate_data()` or `ec_climate_mudata()`.
For example, to find recent daily data for a location close to Wolfville, Nova Scotia, one might do the following::
```{r}
ec_climate_geosearch_locations(
"Wolfville NS", timeframe = "daily",
year = 2017, limit = 5
)
```
```{r}
ec_climate_data(
"WHITE ROCK NS 6507", timeframe = "daily",
start = "2017-01-01", end = "2017-12-31"
)
```
## More information
See `vignette("ec_climate", package = "rclimateca")` and `?ec_climate_data` for more information about using **rclimateca** with the Environment Canada historical climate archive.