Skip to contents

Get and parse NOAA ISD/ISH data


  overwrite = TRUE,
  cleanup = TRUE,
  additional = TRUE,
  parallel = FALSE,
  cores = getOption("cl.cores", 2),
  progress = FALSE,
  force = FALSE,


usaf, wban

(character) USAF and WBAN code. Required


(numeric) One of the years from 1901 to the current year. Required.


(logical) To overwrite the path to store files in or not, Default: TRUE


(logical) If TRUE, remove compressed .gz file at end of function execution. Processing data takes up a lot of time, so we cache a cleaned version of the data. Cleaning up will save you on disk space. Default: TRUE


(logical) include additional and remarks data sections in output. Default: TRUE. Passed on to isdparser::isd_parse()


(logical) do processing in parallel. Default: FALSE


(integer) number of cores to use: Default: 2. We look in your option "cl.cores", but use default value if not found.


(logical) print progress - ignored if parallel=TRUE. The default is FALSE because printing progress adds a small bit of time, so if processing time is important, then keep as FALSE


(logical) force download? Default: FALSE We use a cached version (an .rds compressed file) if it exists, but this will override that behavior.


Curl options passed on to crul::verb-GET


A tibble (data.frame).


isd saves the full set of weather data for the queried site locally in the directory specified by the path argument. You can access the path for the cached file via attr(x, "source")

We use isdparser internally to parse ISD files. They are relatively complex to parse, so a separate package takes care of that.

This function first looks for whether the data for your specific query has already been downloaded previously in the directory given by the path parameter. If not found, the data is requested form NOAA's FTP server. The first time a dataset is pulled down we must a) download the data, b) process the data, and c) save a compressed .rds file to disk. The next time the same data is requested, we only have to read back in the .rds file, and is quite fast. The benfit of writing to .rds files is that data is compressed, taking up less space on your disk, and data is read back in quickly, without changing any data classes in your data, whereas we'd have to jump through hoops to do that with reading in csv. The processing can take quite a long time since the data is quite messy and takes a bunch of regex to split apart text strings. We hope to speed this process up in the future. See examples below for different behavior.


There are now no transformations (scaling, class changes, etc.) done on the output data. This may change in the future with parameters to toggle transformations, but none are done for now. See isdparser::isd_transform() for transformation help. Comprehensive transformations for all variables are not yet available but should be available in the next version of this package.

See isd_cache for managing cached files


Note that when you get an error similar to Error: download failed for, the file does not exist on NOAA's servers. If your internet is down, you'll get a different error.


See also


if (FALSE) {
# Get station table
(stations <- isd_stations())

## plot stations
### remove incomplete cases, those at 0,0
df <- stations[complete.cases(stations$lat, stations$lon), ]
df <- df[df$lat != 0, ]
### make plot
leaflet(data = df) %>%
  addTiles() %>%

# Get data
(res <- isd(usaf='011490', wban='99999', year=1986))
(res <- isd(usaf='011690', wban='99999', year=1993))
(res <- isd(usaf='109711', wban=99999, year=1970))

# "additional" and "remarks" data sections included by default
# can toggle that parameter to not include those in output, saves time
(res1 <- isd(usaf='011490', wban='99999', year=1986, force = TRUE))
(res2 <- isd(usaf='011490', wban='99999', year=1986, force = TRUE,
  additional = FALSE))

# The first time a dataset is requested takes longer
system.time( isd(usaf='782680', wban='99999', year=2011) )
system.time( isd(usaf='782680', wban='99999', year=2011) )

# Plot data
## get data for multiple stations
res1 <- isd(usaf='011690', wban='99999', year=1993)
res2 <- isd(usaf='782680', wban='99999', year=2011)
res3 <- isd(usaf='008415', wban='99999', year=2016)
res4 <- isd(usaf='109711', wban=99999, year=1970)
## combine data
res_all <- bind_rows(res1, res2, res3, res4)
# add date time
dd <- sprintf('%s %s', as.character(res_all$date), res_all$time)
res_all$date_time <- ymd_hm(dd)
## remove 999's
res_all <- filter(res_all, temperature < 900)

## plot
if (interactive()) {
  ggplot(res_all, aes(date_time, temperature)) +
    geom_line() +
    facet_wrap(~usaf_station, scales = 'free_x')

# print progress
## note: if the file is already on your system, you'll see no progress bar
(res <- isd(usaf='011690', wban='99999', year=1993, progress=TRUE))

# parallelize processing
# (res <- isd(usaf=172007, wban=99999, year=2016, parallel=TRUE))