Retrieve GHCN-D Data for Specific Stations
get_data_aws.Rd
This function retrieves GHCN-D data for specified station(s), time period, and variable(s) directly from the NOAA GHCN-D S3 bucket.
Arguments
- station_id
Character vector. One or more 11-character GHCN station identification code(s).
- start_date
Character. Start date in format YYYY, YYYY-MM, or YYYY-MM-DD.
- end_date
Character. End date in format YYYY, YYYY-MM, or YYYY-MM-DD.
- variables
Character vector. GHCN-D element code(s) to retrieve (e.g., c("TMAX", "TMIN", "PRCP")).
- format
Character. Output format, either "wide" (default) or "long".
Examples
# Retrieve temperature data for a station from January 2020 to January 2023
nyc_temp_data <- get_data_aws("USC00305816", "2020-01", "2023-01", c("TMAX", "TMIN"))