-
Notifications
You must be signed in to change notification settings - Fork 84
/
README.Rmd
139 lines (112 loc) · 6.7 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
rnoaa
=====
```{r echo=FALSE}
library("knitr")
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
lines <- options$output.lines
if (is.null(lines)) {
return(hook_output(x, options)) # pass to default hook
}
x <- unlist(strsplit(x, "\n"))
more <- "..."
if (length(lines)==1) { # first n lines
if (length(x) > lines) {
# truncate the output, but add ....
x <- c(head(x, lines), more)
}
} else {
x <- c(if (abs(lines[1])>1) more else NULL,
x[lines],
if (length(x)>lines[abs(length(lines))]) more else NULL
)
}
# paste these lines together
x <- paste(c(x, ""), collapse = "\n")
hook_output(x, options)
})
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE,
fig.width = 10,
fig.path = "man/figures/",
cache.path = "inst/cache/"
)
```
[![Project Status: Unsupported](https://www.repostatus.org/badges/latest/unsupported.svg)](https://www.repostatus.org/#unsupported)
[![cran checks](https://cranchecks.info/badges/worst/rnoaa)](https://cranchecks.info/pkgs/rnoaa)
[![R-check](https://github.com/ropensci/rnoaa/workflows/R-check/badge.svg)](https://github.com/ropensci/rnoaa/actions)
[![codecov.io](https://codecov.io/github/ropensci/rnoaa/coverage.svg?branch=master)](https://codecov.io/github/ropensci/rnoaa?branch=master)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/rnoaa?color=C9A115)](https://github.com/r-hub/cranlogs.app)
[![cran version](https://www.r-pkg.org/badges/version/rnoaa)](https://cran.r-project.org/package=rnoaa)
`rnoaa` is an R interface to many NOAA data sources. We don't cover all of them, but we include many commonly used sources, and add we are always adding new sources. We focus on easy to use interfaces for getting NOAA data, and giving back data in easy to use formats downstream. We currently don't do much in the way of plots or analysis. To get started see: https://docs.ropensci.org/rnoaa/articles/rnoaa.html
## NOTICE: PACKAGE TO BE ARCHIVED
NOAA has changed not only the base URL of the API but reorganized the structure and endpoints of the data and API. The current `rnoaa` package is still functional with the NOAA API v2 but the data available in the API end at approximately 2022-09-15. A new NOAA weather package is planned to replace rnoaa functionality where possible. At that point the rnoaa package will be archived.
## Data sources in rnoaa
* NOAA NCDC climate data:
* We are using the NOAA API version 2
* Docs for the NCDC API are at https://www.ncdc.noaa.gov/cdo-web/webservices/v2
* GHCN Daily data is available at http://www.ncdc.noaa.gov/ghcn-daily-description via FTP and HTTP
* Severe weather data docs are at https://www.ncdc.noaa.gov/swdiws/
* Sea ice data (ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/shapefiles)
* NOAA buoy data (https://www.ndbc.noaa.gov/)
* ERDDAP data (https://upwell.pfeg.noaa.gov/erddap/index.html)
* Now in package rerddap (https://github.com/ropensci/rerddap)
* Tornadoes! Data from the NOAA Storm Prediction Center (https://www.spc.noaa.gov/gis/svrgis/)
* HOMR - Historical Observing Metadata Repository (http://www.ncdc.noaa.gov/homr/api)
* GHCND FTP data (ftp://ftp.ncdc.noaa.gov/pub/data/noaa) - NOAA NCDC API has some/all (not sure really) of this data, but FTP allows to get more data more quickly
* Extended Reconstructed Sea Surface Temperature (ERSST) data (https://www.ncdc.noaa.gov/data-access/marineocean-data/extended-reconstructed-sea-surface-temperature-ersst-v4)
* NOAA CO-OPS - tides and currents data (https://tidesandcurrents.noaa.gov/)
* NOAA Climate Prediction Center (CPC) (http://www.cpc.ncep.noaa.gov/)
* Africa Rainfall Climatology version 2 (ftp://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/ARC2_readme.txt)
* Blended Sea Winds (https://www.ncdc.noaa.gov/data-access/marineocean-data/blended-global/blended-sea-winds)
* Local Climatological Data (https://www.ncdc.noaa.gov/cdo-web/datatools/lcd)
* Storm Events Database (https://www.ncdc.noaa.gov/stormevents/)
## Help/Getting Started
Documentation is at https://docs.ropensci.org/rnoaa/, and there are many vignettes in the package itself, available in your R session, or on CRAN (https://cran.r-project.org/package=rnoaa). The tutorials:
* **Getting started - start here**
* NOAA Buoy vignette
* NOAA National Climatic Data Center (NCDC) vignette (examples)
* NOAA NCDC attributes vignette
* NOAA NCDC workflow vignette
* Sea ice vignette
* Severe Weather Data Inventory (SWDI) vignette
* Historical Observing Metadata Repository (HOMR) vignette
## netcdf data
Some functions use netcdf files, including:
* `ersst`
* `buoy`
* `bsw`
* `argo`
You'll need the `ncdf4` package for those functions, and those only. `ncdf4` is in Suggests in this package, meaning you only need `ncdf4` if you are using any of the functions listed above. You'll get an informative error telling you to install `ncdf4` if you don't have it and you try to use the those functions. Installation of `ncdf4` should be straightforward on any system. See https://cran.r-project.org/package=ncdf4
## NOAA NCDC Datasets
There are many NOAA NCDC datasets. All data sources work, except `NEXRAD2` and `NEXRAD3`, for an unknown reason. This relates to `ncdc_*()` functions only.
```{r echo=FALSE}
library('rnoaa')
dat <- ncdc_datasets()$data
dat <- dat[, !names(dat) %in% 'uid']
dat <- dat[, c('id', 'name', 'mindate', 'maxdate', 'datacoverage')]
names(dat) <- c('Dataset', 'Description', 'Start Date', 'End Date', 'Data Coverage')
knitr::kable(dat)
```
```{r echo=FALSE}
cat(paste0("table updated on ", Sys.Date()))
```
**NOAA NCDC Attributes**
Each NOAA dataset has a different set of attributes that you can potentially get back in your search. See https://www.ncei.noaa.gov/access for detailed info on each dataset. We provide some information on the attributes in this package; see the vignette for attributes (https://docs.ropensci.org/rnoaa/articles/ncdc_attributes.html) to find out more
## Contributors
* Scott Chamberlain (https://github.com/sckott)
* Daniel Hocking (https://github.com/djhocking)
* Brooke Anderson (https://github.com/geanders)
* Maëlle Salmon (https://github.com/maelle)
* Adam Erickson (https://github.com/adam-erickson)
* Nicholas Potter (https://github.com/potterzot)
* Joseph Stachelek (https://github.com/jsta)
* Daniel Hocking (https://github.com/djhocking)
## Meta
* Please report any issues or bugs: https://github.com/ropensci/rnoaa/issues
* License: MIT
* Get citation information for `rnoaa` in R doing `citation(package = 'rnoaa')`
* Please note that this package is released with a Contributor Code of Conduct (https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.