import_departure: Import monthly departure data

View source: R/import_departure.R

import_departureR Documentation

Import monthly departure data

Description

This function imports monthly departure data from ClimateAnalyzer.org into R.

Usage

import_departure(
  station_id,
  start_year,
  end_year = NULL,
  month = "all",
  norm_per = "1981-2010",
  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.

month

A number for the month, 1 for January through 12 for December or 'all' for all months. Default is 'all'.

norm_per

A character string for the 30-year normalization period. Either '1971-2000', '1981-2010', or '1991-2020'. Default is '1981-2010'.

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 monthly departures
import_departure(station_id = 'natural_bridges_nm', start_year = 2000)

# Import departures for the month of July  and convert values to metric
import_departure(station_id = 'natural_bridges_nm', start_year = 2000,
                 end_year = 2020, month = 7, convert = TRUE)


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