You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,13 +32,12 @@ Accessing CDO data requires a token.
32
32
33
33
Get a token by going to [www.ncdc.noaa.gov/cdo-web/token](https://www.ncdc.noaa.gov/cdo-web/token) and entering your email address.
34
34
35
+
### Functions
35
36
36
-
## `get_climate_data()`
37
+
###`get_climate_data()`
37
38
38
39
The `get_climate_data()` function allows you to retrieve climate and weather data from the [NOAA Climate Data Online (CDO) API](https://www.ncdc.noaa.gov/cdo-web/webservices/v2#gettingStarted) for a wide range of dataset types. It supports pagination and can retrieve large numbers of records by iteratively querying the API.
|`enddate`|`string`| End date for the query in `"YYYY-MM-DD"` format. |
56
55
|`n_results`|`numeric`| Maximum number of results to return. Use `Inf` (default) to fetch all available records. |
57
56
58
-
### Supported Dataset IDs
57
+
Supported Dataset IDs:
59
58
60
59
The function currently supports the following datasets:
61
60
@@ -72,7 +71,7 @@ The function currently supports the following datasets:
72
71
-`AGRMET` – Agricultural Meteorological data
73
72
-`STORM_EVENTS` – Storm event data
74
73
75
-
### Example
74
+
Example:
76
75
77
76
```r
78
77
# Example: Get daily precipitation for Central Park, NY in January 2020
@@ -87,12 +86,10 @@ df <- get_climate_data(
87
86
```
88
87
89
88
90
-
## `get_locationid()`
89
+
###`get_locationid()`
91
90
92
91
The `get_locationid()` function retrieves location identifiers from the NOAA Climate Data Online (CDO) API based on a specified category. It supports pagination to return large sets of location data.
|`category_id`|`string`| The location category identifier. Must be one of the valid location categories (see below). |
106
103
|`n_results`|`numeric`| Maximum number of results to retrieve. Defaults to `Inf` to fetch all available records. |
107
104
108
-
### Supported Location Category IDs
105
+
Supported Location Category IDs:
109
106
110
107
The function supports the following location categories:
111
108
@@ -117,7 +114,7 @@ The function supports the following location categories:
117
114
-`HYDROL_REG` – Hydrologic regions used for water resource planning
118
115
-`FIPS` – Federal Information Processing Standards codes (e.g., `"FIPS:37"` for North Carolina)
119
116
120
-
### Example
117
+
Example:
121
118
122
119
```r
123
120
# Example: Retrieve a list of U.S. states
@@ -128,15 +125,15 @@ df <- get_locationid(
128
125
)
129
126
```
130
127
131
-
### Returns
128
+
Returns:
132
129
133
130
A data frame containing location metadata from the specified category. If no results are returned or the request fails, an error is thrown or an empty data frame is returned.
134
131
135
-
## `get_stationid()`
132
+
###`get_stationid()`
136
133
137
134
The `get_stationid()` function retrieves weather station metadata from the NOAA Climate Data Online (CDO) API for a given dataset and time range. It supports pagination and can return a large number of station records.
|`enddate`|`string`| End date in `"YYYY-MM-DD"` format. |
154
151
|`n_results`|`numeric`| Maximum number of station records to retrieve. Defaults to `Inf` to fetch all. |
155
152
156
-
### Example
153
+
Example:
157
154
158
155
```r
159
156
# Example: Get stations in Texas for the GHCND dataset during 2020
@@ -167,10 +164,8 @@ df <- get_stationid(
167
164
)
168
165
```
169
166
170
-
### Returns
167
+
Returns:
171
168
172
169
A data frame containing weather station metadata, such as station IDs, names, geographic coordinates, and available coverage. If no results are returned or the request fails, an error is thrown or an empty data frame is returned.
173
170
174
-
175
-
176
171
A detailed list of NOAA acronyms can be found here: https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt
0 commit comments