Skip to contents

This function accesses a data inventory of GHCN stations available through either the GHCNh or GHCNd. The returned data.frame contains data which reveals the earliest and latest years of data available for each station from the NOAA database.

Usage

import_ghcn_inventory(
  database = c("hourly", "daily"),
  pivot = c("wide", "long"),
  progress = rlang::is_interactive()
)

Arguments

database

One of "hourly" or "daily", which defines whether to import the GHCNh or GHCNd inventory. The way in which these files is formatted is different.

pivot

One of "wide" or "long". The GHCNh inventory can be returned in a "wide" format (with id, year and twelve month columns) or a "long" format (with id, year, month, and count columns). Does not apply to the GHCNd inventory.

progress

The inventory file is large and can be slow to download. Show a progress indicator when accessing the inventory? Defaults to TRUE in interactive R sessions. Passed to progress in readr::read_fwf() and/or purrr::pmap().

Value

a tibble

Author

Jack Davison