Skip to content

Commit 5d36c4a

Browse files
committed
remove references to deprecated functions in documentation
1 parent 9fe17ef commit 5d36c4a

6 files changed

Lines changed: 92 additions & 159 deletions

File tree

README.Rmd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ knitr::opts_chunk$set(
2525
## Introduction
2626

2727
The GSOD or [Global Surface Summary of the Day (GSOD)](https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C00516) data provided by the US National Centers for Environmental Information (NCEI) are a valuable source of weather data with global coverage.
28-
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides five main functions for facilitating this:
28+
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides four main functions for facilitating this:
2929

3030
- `get_GSOD()` - this function queries and transfers files from the NCEI's web server, reformats them and returns a data frame.
3131

3232
- `reformat_GSOD()` - this function takes individual station files from the local disk and re-formats them returning a data frame.
3333

3434
- `nearest_stations()` - this function returns a `data.table` of stations with their metadata and the distance in which they fall from the given radius (kilometres) of a point given as latitude and longitude in order from nearest to farthest.
3535

36-
- `get_inventory()` - this function downloads the latest station inventory information from the NCEI's server and returns the header information about the latest version as a message in the console and a tidy data frame of the stations' inventory for each month that data are reported.
37-
3836
- `get_updates()` - this function downloads the changelog for the GSOD data from the NCEI's server and reorders it by the most recent changes first.
3937

4038
When reformatting data either with `get_GSOD()` or `reformat_GSOD()`, all units are converted to International System of Units (SI), _e.g._, inches to millimetres and Fahrenheit to Celsius.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@
1818
## Introduction
1919

2020
The GSOD or [Global Surface Summary of the Day (GSOD)](https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C00516) data provided by the US National Centers for Environmental Information (NCEI) are a valuable source of weather data with global coverage.
21-
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides five main functions for facilitating this:
21+
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides four main functions for facilitating this:
2222

2323
- `get_GSOD()` - this function queries and transfers files from the NCEI's web server, reformats them and returns a data frame.
2424

2525
- `reformat_GSOD()` - this function takes individual station files from the local disk and re-formats them returning a data frame.
2626

2727
- `nearest_stations()` - this function returns a `data.table` of stations with their metadata and the distance in which they fall from the given radius (kilometres) of a point given as latitude and longitude in order from nearest to farthest.
2828

29-
- `get_inventory()` - this function downloads the latest station inventory information from the NCEI's server and returns the header information about the latest version as a message in the console and a tidy data frame of the stations' inventory for each month that data are reported.
30-
3129
- `get_updates()` - this function downloads the changelog for the GSOD data from the NCEI's server and reorders it by the most recent changes first.
3230

3331
When reformatting data either with `get_GSOD()` or `reformat_GSOD()`, all units are converted to International System of Units (SI), _e.g._, inches to millimetres and Fahrenheit to Celsius.

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
"applicationCategory": "Tools",
368368
"isPartOf": "https://ropensci.org",
369369
"keywords": ["US-NCEI", "meteorological-data", "global-weather", "weather", "weather-data", "meteorology", "station-data", "surface-weather", "data-access", "US-NCDC", "r", "gsod", "ncdc", "weather-stations", "global-data", "ncei", "weather-information", "historical-weather", "historical-data", "daily-data", "daily-weather", "rstats", "r-package"],
370-
"fileSize": "3897.359KB",
370+
"fileSize": "3892.892KB",
371371
"citation": [
372372
{
373373
"@type": "SoftwareSourceCode",

vignettes/GSODR.Rmd

Lines changed: 88 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ bibliography: references.bib
1717

1818
The GSOD or [Global Surface Summary of the Day (GSOD)](https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C00516) data provided by the US National Centers for Environmental Information (NCEI) are a valuable source of weather data with global coverage.
1919
However, the data files are cumbersome and difficult to work with.
20-
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides five main functions for facilitating this:
20+
{GSODR} aims to make it easy to find, transfer and format the data you need for use in analysis and provides four main functions for facilitating this:
2121

2222
- `get_GSOD()` - this function queries and transfers files from the NCEI's web server, reformats them and returns a data frame.
2323

2424
- `reformat_GSOD()` - this function takes individual station files from the local disk and re-formats them returning a data frame.
2525

2626
- `nearest_stations()` - this function returns a `data.table` of stations with their metadata and the distance in which they fall from the given radius (kilometres) of a point given as latitude and longitude in order from nearest to farthest.
2727

28-
- `get_inventory()` - this function downloads the latest station inventory information from the NCEI's server and returns the header information about the latest version as a message in the console and a tidy data frame of the stations' inventory for each month that data are reported.
29-
3028
- `get_updates()` - this function downloads the changelog for the GSOD data from the NCEI's server and reorders it by the most recent changes first.
3129

3230
When reformatting data either with `get_GSOD()` or `reformat_GSOD()`, all units are converted from United States Customary System (USCS) to International System of Units (SI), _e.g._, inches to millimetres and Fahrenheit to Celsius.
@@ -44,24 +42,7 @@ It's easy to find all stations in Australia.
4442

4543
``` r
4644
library("GSODR")
47-
```
48-
49-
```
50-
## Warning in runHook(".onAttach", ns, dirname(nspath), nsname): restarting
51-
## interrupted promise evaluation
52-
```
53-
54-
```
55-
## Warning in runHook(".onAttach", ns, dirname(nspath), nsname): internal error 1
56-
## in R_decompress1 with libdeflate
57-
```
58-
59-
```
60-
## Error: package or namespace load failed for 'GSODR' in runHook(".onAttach", ns, dirname(nspath), nsname):
61-
## lazy-load database '/Users/adamsparks/Library/R/arm64/4.5/library/GSODR/R/GSODR.rdb' is corrupt
62-
```
6345

64-
``` r
6546
load(system.file("extdata", "isd_history.rda", package = "GSODR"))
6647

6748
# create data.frame for Australia only
@@ -72,32 +53,32 @@ Oz
7253

7354
```
7455
## Key: <STNID>
75-
## STNID NAME LAT LON ELEV(M) CTRY STATE
76-
## <char> <char> <num> <num> <num> <char> <char>
77-
## 1: 110010-99999 WOLFSEGG 48.100 13.667 615.6 AU
78-
## 2: 110030-99999 RIED IM INNKREIS 48.217 13.483 443.0 AU
79-
## 3: 110050-99999 SCHAERDING/SUBEN 48.400 13.433 330.0 AU
80-
## 4: 110080-99999 ROHRBACH 48.567 14.000 602.0 AU
81-
## 5: 110090-99999 WELS/FLUGFELD 48.183 14.033 318.0 AU
82-
## ---
83-
## 272: 958070-99999 KINGSTONE AERO -35.717 137.517 6.0 AU
84-
## 273: 958150-99999 MUNKORA -36.100 140.317 28.0 AU
85-
## 274: 958230-99999 PADTHAWAY SOUTH -36.650 140.517 35.0 AU
86-
## 275: 958310-99999 WALPEUP RESEARCH -35.117 142.000 105.0 AU
87-
## 276: 958450-99999 MT GELLIBRAND -38.233 143.783 262.0 AU
88-
## BEGIN END COUNTRY_NAME ISO2C ISO3C
89-
## <int> <int> <char> <char> <char>
90-
## 1: 19730715 20250824 AUSTRALIA AU AUS
91-
## 2: 19520103 19971225 AUSTRALIA AU AUS
92-
## 3: 20010807 20010807 AUSTRALIA AU AUS
93-
## 4: 19761101 20250824 AUSTRALIA AU AUS
94-
## 5: 19340502 20050814 AUSTRALIA AU AUS
95-
## ---
96-
## 272: 19970101 20250824 AUSTRALIA AU AUS
97-
## 273: 20030401 20250824 AUSTRALIA AU AUS
98-
## 274: 20030401 20250824 AUSTRALIA AU AUS
99-
## 275: 20010915 20250824 AUSTRALIA AU AUS
100-
## 276: 20010918 20250824 AUSTRALIA AU AUS
56+
## STNID NAME LAT LON ELEV(M) CTRY
57+
## <char> <char> <num> <num> <num> <char>
58+
## 1: 695023-99999 HORN ISLAND (HID) -10.583 142.300 NA AS
59+
## 2: 749430-99999 AIDELAIDE RIVER SE -13.300 131.133 131.0 AS
60+
## 3: 749432-99999 BATCHELOR FIELD AUSTRALIA -13.049 131.066 107.0 AS
61+
## 4: 749438-99999 IRON RANGE AUSTRALIA -12.700 143.300 18.0 AS
62+
## 5: 749439-99999 MAREEBA AS/HOEVETT FIELD -17.050 145.400 443.0 AS
63+
## ---
64+
## 1252: 959810-99999 ST HELENS AERODROME -41.333 148.267 49.0 AS
65+
## 1253: 959820-99999 STORYS CREEK AWS -41.617 147.733 781.0 AS
66+
## 1254: 959830-99999 SCAMANDER -41.467 148.267 3.0 AS
67+
## 1255: 959840-99999 ORFORD -42.550 147.867 15.0 AS
68+
## 1256: 999999-82101 NORTHWEST CAPE -22.333 114.050 38.1 AS
69+
## STATE BEGIN END COUNTRY_NAME ISO2C ISO3C
70+
## <char> <int> <int> <char> <char> <char>
71+
## 1: 19420804 20030816 AUSTRALIA AU AUS
72+
## 2: 19430228 19440821 AUSTRALIA AU AUS
73+
## 3: 19421231 19430610 AUSTRALIA AU AUS
74+
## 4: 19420917 19440930 AUSTRALIA AU AUS
75+
## 5: 19420630 19440630 AUSTRALIA AU AUS
76+
## ---
77+
## 1252: 20010918 20250824 AUSTRALIA AU AUS
78+
## 1253: 19900201 19971231 AUSTRALIA AU AUS
79+
## 1254: 19740228 20130328 AUSTRALIA AU AUS
80+
## 1255: 19900201 20230924 AUSTRALIA AU AUS
81+
## 1256: 19680305 19680430 AUSTRALIA AU AUS
10182
```
10283

10384
``` r
@@ -106,7 +87,15 @@ subset(Oz, grepl("TOOWOOMBA", NAME))
10687
```
10788

10889
```
109-
## Empty data.table (0 rows and 12 cols): STNID,NAME,LAT,LON,ELEV(M),CTRY...
90+
## Key: <STNID>
91+
## STNID NAME LAT LON ELEV(M) CTRY STATE
92+
## <char> <char> <num> <num> <num> <char> <char>
93+
## 1: 945510-99999 TOOWOOMBA -27.583 151.933 676 AS
94+
## 2: 955510-99999 TOOWOOMBA AIRPORT -27.550 151.917 642 AS
95+
## BEGIN END COUNTRY_NAME ISO2C ISO3C
96+
## <int> <int> <char> <char> <char>
97+
## 1: 19561231 19971231 AUSTRALIA AU AUS
98+
## 2: 19980301 20250824 AUSTRALIA AU AUS
11099
```
111100

112101
## Download a Single Station and Year Using get_GSOD()
@@ -116,65 +105,58 @@ Now that we've seen where the reporting stations are located, we can download we
116105

117106
``` r
118107
tbar <- get_GSOD(years = 2010, station = "955510-99999")
119-
```
120-
121-
```
122-
## Error in get_GSOD(years = 2010, station = "955510-99999"): could not find function "get_GSOD"
123-
```
124-
125-
``` r
126108
str(tbar)
127109
```
128110

129111
```
130-
## Classes 'data.table' and 'data.frame': 1095 obs. of 47 variables:
131-
## $ STNID : chr "945520-99999" "945520-99999" "945520-99999" "945520-99999" ...
132-
## $ NAME : chr "OAKEY" "OAKEY" "OAKEY" "OAKEY" ...
112+
## Classes 'data.table' and 'data.frame': 365 obs. of 47 variables:
113+
## $ STNID : chr "955510-99999" "955510-99999" "955510-99999" "955510-99999" ...
114+
## $ NAME : chr "TOOWOOMBA AIRPORT" "TOOWOOMBA AIRPORT" "TOOWOOMBA AIRPORT" "TOOWOOMBA AIRPORT" ...
133115
## $ CTRY : chr "AS" "AS" "AS" "AS" ...
134116
## $ COUNTRY_NAME : chr "AUSTRALIA" "AUSTRALIA" "AUSTRALIA" "AUSTRALIA" ...
135117
## $ ISO2C : chr "AU" "AU" "AU" "AU" ...
136118
## $ ISO3C : chr "AUS" "AUS" "AUS" "AUS" ...
137119
## $ STATE : chr "" "" "" "" ...
138-
## $ LATITUDE : num -27.4 -27.4 -27.4 -27.4 -27.4 ...
120+
## $ LATITUDE : num -27.6 -27.6 -27.6 -27.6 -27.6 ...
139121
## $ LONGITUDE : num 152 152 152 152 152 ...
140-
## $ ELEVATION : num 407 407 407 407 407 ...
141-
## $ BEGIN : int 19730430 19730430 19730430 19730430 19730430 19730430 19730430 19730430 19730430 19730430 ...
122+
## $ ELEVATION : num 642 642 642 642 642 642 642 642 642 642 ...
123+
## $ BEGIN : int 19980301 19980301 19980301 19980301 19980301 19980301 19980301 19980301 19980301 19980301 ...
142124
## $ END : int 20250824 20250824 20250824 20250824 20250824 20250824 20250824 20250824 20250824 20250824 ...
143125
## $ YEARMODA : Date, format: "2010-01-01" "2010-01-02" ...
144126
## $ YEAR : int 2010 2010 2010 2010 2010 2010 2010 2010 2010 2010 ...
145127
## $ MONTH : int 1 1 1 1 1 1 1 1 1 1 ...
146128
## $ DAY : int 1 2 3 4 5 6 7 8 9 10 ...
147129
## $ YDAY : int 1 2 3 4 5 6 7 8 9 10 ...
148-
## $ TEMP : num 23.4 26.2 24.5 21.6 22.6 24.7 24 23.3 24.4 25.1 ...
149-
## $ TEMP_ATTRIBUTES : int 16 16 16 16 16 16 16 16 16 16 ...
150-
## $ DEWP : num 18.4 19.4 19.4 16.8 16.9 18.7 17.1 17.1 15.7 13.6 ...
151-
## $ DEWP_ATTRIBUTES : int 16 16 16 16 16 16 16 16 16 16 ...
152-
## $ SLP : num 1012 1009 1011 1015 1015 ...
153-
## $ SLP_ATTRIBUTES : int 16 16 16 16 16 16 16 16 16 16 ...
154-
## $ STP : num 967 964 966 969 969 ...
155-
## $ STP_ATTRIBUTES : int 16 16 16 16 16 16 16 16 16 16 ...
156-
## $ VISIB : num NA NA NA NA NA NA NA NA NA NA ...
157-
## $ VISIB_ATTRIBUTES: int 0 0 0 0 0 0 0 0 0 0 ...
158-
## $ WDSP : num 4.3 4.1 6.1 7.5 4.4 4.3 5.8 6.2 5.6 4.5 ...
159-
## $ WDSP_ATTRIBUTES : int 16 16 16 16 16 16 16 16 16 16 ...
160-
## $ MXSPD : num 7.2 6.2 8.7 9.8 7.7 6.2 8.2 9.3 7.7 7.2 ...
130+
## $ TEMP : num 21.2 23.2 21.4 18.9 20.5 21.9 21.3 20.9 21.9 22.3 ...
131+
## $ TEMP_ATTRIBUTES : int 8 8 8 8 8 8 8 8 8 8 ...
132+
## $ DEWP : num 17.9 19.4 18.9 16.4 16.4 18.7 17.4 17.1 16.2 14.9 ...
133+
## $ DEWP_ATTRIBUTES : int 8 8 8 8 8 8 8 8 8 8 ...
134+
## $ SLP : num 1013 1010 1012 1016 1016 ...
135+
## $ SLP_ATTRIBUTES : int 8 8 8 8 8 8 8 8 8 8 ...
136+
## $ STP : num 942 939 941 944 944 ...
137+
## $ STP_ATTRIBUTES : int 8 8 8 8 8 8 8 8 8 8 ...
138+
## $ VISIB : num NA NA 14.3 23.3 NA NA NA NA NA NA ...
139+
## $ VISIB_ATTRIBUTES: int 0 0 6 4 0 0 0 0 0 0 ...
140+
## $ WDSP : num 4.3 3.7 7.6 8.7 7.5 6.3 7.8 7.5 6.8 6.3 ...
141+
## $ WDSP_ATTRIBUTES : int 8 8 8 8 8 8 8 8 8 8 ...
142+
## $ MXSPD : num 6.7 5.1 10.3 10.3 10.8 7.7 8.7 8.7 8.2 7.2 ...
161143
## $ GUST : num NA NA NA NA NA NA NA NA NA NA ...
162-
## $ MAX : num 28.5 31.2 33.6 27.1 27.8 30.4 30 30.5 31.9 33.2 ...
144+
## $ MAX : num 25.8 26.5 28.7 24.1 24.6 26.8 26.1 26.5 27.4 28.7 ...
163145
## $ MAX_ATTRIBUTES : chr NA NA NA NA ...
164-
## $ MIN : num 19.5 20.5 21.3 18.8 18.4 18.6 20.6 18.6 17.2 16.2 ...
146+
## $ MIN : num 17.8 19.1 19.3 16.9 16.7 17.5 19.1 18.5 17.8 17.7 ...
165147
## $ MIN_ATTRIBUTES : chr NA NA "*" "*" ...
166-
## $ PRCP : num 0.51 0 3.3 0 0 0 0 0.25 0 0 ...
148+
## $ PRCP : num 1.52 0.25 19.81 1.02 0.25 ...
167149
## $ PRCP_ATTRIBUTES : chr "G" "G" "G" "G" ...
168150
## $ SNDP : num NA NA NA NA NA NA NA NA NA NA ...
169-
## $ I_FOG : num 0 0 0 0 0 0 0 0 0 0 ...
170-
## $ I_RAIN_DRIZZLE : num 0 0 0 0 0 0 0 0 0 0 ...
151+
## $ I_FOG : num 0 0 1 0 0 1 1 0 1 1 ...
152+
## $ I_RAIN_DRIZZLE : num 0 0 1 0 0 0 0 0 0 0 ...
171153
## $ I_SNOW_ICE : num 0 0 0 0 0 0 0 0 0 0 ...
172154
## $ I_HAIL : num 0 0 0 0 0 0 0 0 0 0 ...
173155
## $ I_THUNDER : num 0 0 0 0 0 0 0 0 0 0 ...
174156
## $ I_TORNADO_FUNNEL: num 0 0 0 0 0 0 0 0 0 0 ...
175-
## $ EA : num 2.1 2.2 2.2 1.9 1.9 2.2 1.9 1.9 1.8 1.6 ...
176-
## $ ES : num 2.9 3.4 3.1 2.6 2.7 3.1 3 2.9 3.1 3.2 ...
177-
## $ RH : num 73.5 66.2 73.3 74.2 70.2 69.3 65.3 68.2 58.4 48.9 ...
157+
## $ EA : num 2 2.2 2.2 1.9 1.9 2.2 2 1.9 1.8 1.7 ...
158+
## $ ES : num 2.5 2.8 2.5 2.2 2.4 2.6 2.5 2.5 2.6 2.7 ...
159+
## $ RH : num 81.5 79.2 85.7 85.4 77.3 82.1 78.5 78.9 70.1 62.9 ...
178160
## - attr(*, ".internal.selfref")=<externalptr>
179161
```
180162

@@ -190,18 +172,26 @@ Warning messages will be generated as not all stations have data for the request
190172
tbar_stations <- nearest_stations(LAT = -27.5598,
191173
LON = 151.9507,
192174
distance = 50)$STNID
175+
176+
tbar <- get_GSOD(years = 2010, station = tbar_stations)
193177
```
194178

195179
```
196-
## Error in nearest_stations(LAT = -27.5598, LON = 151.9507, distance = 50): could not find function "nearest_stations"
180+
## Warning:
181+
## This station, 945510-99999, only provides data for years 1956 to 1997.
182+
## Please send a request that falls within these years.
197183
```
198184

199-
``` r
200-
tbar <- get_GSOD(years = 2010, station = tbar_stations)
185+
```
186+
## Warning:
187+
## This station, 949999-00170, only provides data for years 1971 to 1984.
188+
## Please send a request that falls within these years.
201189
```
202190

203191
```
204-
## Error in get_GSOD(years = 2010, station = tbar_stations): could not find function "get_GSOD"
192+
## Warning:
193+
## This station, 949999-00183, only provides data for years 1983 to 1984.
194+
## Please send a request that falls within these years.
205195
```
206196

207197
``` r
@@ -337,56 +327,19 @@ get_updates()
337327
```
338328

339329
```
340-
## Error in get_updates(): could not find function "get_updates"
341-
```
342-
343-
# Using get_inventory()
344-
345-
{GSODR} provides a function, `get_inventory()` to retrieve an inventory of the number of weather observations by station-year-month for the beginning of record through to current.
346-
347-
Following is an example of how to retrieve the inventory and check a station in Toowoomba, Queensland, Australia, which was used in an earlier example.
348-
349-
350-
``` r
351-
inventory <- get_inventory()
352-
```
353-
354-
```
355-
## Error in get_inventory(): could not find function "get_inventory"
356-
```
357-
358-
``` r
359-
inventory
360-
```
361-
362-
```
363-
## Warning in get(method, envir = home): internal error 1 in R_decompress1 with
364-
## libdeflate
365-
```
366-
367-
```
368-
## Error in get(method, envir = home): lazy-load database '/Users/adamsparks/Library/R/arm64/4.5/library/GSODR/R/GSODR.rdb' is corrupt
369-
```
370-
371-
``` r
372-
subset(inventory, STNID %in% "955510-99999")
373-
```
374-
375-
```
376-
## Warning in print(x): restarting interrupted promise evaluation
377-
```
378-
379-
```
380-
## Warning in get(method, envir = home): restarting interrupted promise evaluation
381-
```
382-
383-
```
384-
## Warning in get(method, envir = home): internal error 1 in R_decompress1 with
385-
## libdeflate
386-
```
387-
388-
```
389-
## Error in get(method, envir = home): lazy-load database '/Users/adamsparks/Library/R/arm64/4.5/library/GSODR/R/GSODR.rdb' is corrupt
330+
## STNID YEAR DATE COMMENT
331+
## <char> <int> <Date> <char>
332+
## 1: ******-***** 2025 2025-08-29 ENTIRE YEAR WAS REPLACED
333+
## 2: ******-***** 2024 2025-01-21 ENTIRE YEAR WAS REPLACED
334+
## 3: ******-***** 2023 2024-01-05 ENTIRE YEAR WAS REPLACED
335+
## 4: ******-***** 2022 2023-05-18 ENTIRE YEAR WAS REPLACED
336+
## 5: ******-***** 1997 2022-08-31 ENTIRE YEAR WAS REPLACED
337+
## ---
338+
## 5451: ******-***** 1968 2004-11-12 ENTIRE YEAR WAS REPLACED
339+
## 5452: ******-***** 1969 2004-11-12 ENTIRE YEAR WAS REPLACED
340+
## 5453: ******-***** 1970 2004-11-10 ENTIRE YEAR WAS REPLACED
341+
## 5454: ******-***** 1971 2004-11-10 ENTIRE YEAR WAS REPLACED
342+
## 5455: ******-***** 1972 2004-11-09 ENTIRE YEAR WAS REPLACED
390343
```
391344

392345
# Notes

0 commit comments

Comments
 (0)