import_annual: Import annual temperature and precipitation data

View source: R/import_annual.R

import_annualR Documentation

Import annual temperature and precipitation data

Description

This function imports annual temperature and precipitation data from ClimateAnalyzer.org into R.

Usage

import_annual(
  station_id,
  start_year,
  end_year = NULL,
  screen_blanks = "true",
  remove_missing = TRUE,
  convert = FALSE
)

Arguments

station_id

The character string of the station_id field from stations.

start_year

The four digit number of the first year of interest.

end_year

The four digit number of the last year of interest. Default is NULL. If NULL, current year will be used.

screen_blanks

A character string stating if years with 15 or more missing values will be screened out and the data replaced with NA. Options are 'true' or 'false', in lower case not upper case. This object is included directly into the URL to retrieve the data from ClimateAnalyzer.org.

remove_missing

Logical. If TRUE, columns that tally missing values are excluded from result. If FALSE, these columns are included in the result. Default is TRUE.

convert

Logical. If TRUE, data are precipitation and temperature values are converted to metric. These converted values are included as additional columns in the data frame denoted by "_mm" or "_C". Default is FALSE.

Value

A tibble.

See Also

The import_data wrapper function.

Examples

library(climateAnalyzeR)

# Import annual temperature and precipitation data
import_annual(station_id = "zion_np", start_year = 1980)

# Import annual temperature and precipitation data and convert values to metric
import_annual(station_id = "zion_np", start_year = 1980, end_year = 2020,
              convert = TRUE)


scoyoc/climateAnalyzeR documentation built on April 19, 2023, 9:57 p.m.