import_daily: Import daily weather data

View source: R/import_daily.R

import_dailyR Documentation

Import daily weather data

Description

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

Usage

import_daily(
  station_id,
  start_year,
  end_year = NULL,
  station_type,
  convert = FALSE
)

Arguments

station_id

The character string of the station_id field from stations.

start_year

The four digit number of the last 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.

station_type

A character string for the type of weather station the data are being pulled from. Options include "GHCN" and "SNOTEL".

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 daily temperature and precipitation data
import_daily(station_id = "arches", start_year = 2010, station_type = "GHCN")

# Import daily temperature and precipitation data and convert values to metric
import_daily(station_id = "arches", start_year = 2010, end_year = 2020,
             station_type = "GHCN", convert = TRUE)


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