import_data: Read data from ClimateAnalyzer.org into R.

View source: R/import_data.R

import_dataR Documentation

Read data from ClimateAnalyzer.org into R.

Description

This is a wrapper for data import functions in the climateAnalyzeR package.

Usage

import_data(data_type, station_id, start_year, end_year = NULL, ...)

Arguments

data_type

A character string for the type of data to import.

  • annual_wx: Annual temperature and precipitation data. See import_annual for details.

  • daily_wx: Daily temperature and precipitation data. See import_daily for details.

  • departure: Monthly departure data. See import_departure for details.

  • monthly_wx: Monthly temperature and precipitation data. See import_monthly for details.

  • water_balance: Water balance data. See import_water_balance for details.

  • extreme_temp: Days below and above percentile temp data. See import_extreme_temp for details.

  • below_above_tempe: Days below and above user set temp data. See import_below_above_temp for details.

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.

...

Other arguments to pass to the import functions.

Value

A tibble.

See Also

See import_annual, import_daily, import_departure, import_monthly, import_extreme_temp, import_below_above_temp, and import_water_balance for details.

Examples

library(climateAnalyzeR)

#-- Wrapper Function
# Import annual temperature and precipitation data
import_data("annual_wx", station_id = "zion_np", start_year = 1980)

# Import daily temperature and precipitation data
import_data("daily_wx", station_id = "arches", start_year = 2010,
            station_type = "GHCN")

# Import monthly departures
import_data("departure", station_id = "natural_bridges_nm", start_year = 2000)

# Import monthly precipitation and temperature data
import_data("monthly_wx", station_id = "canyonlands_theneedle",
            start_year = 2000)

# Import monthly water balance data using the Hamon model with soil water
# capacity set to 100.
import_data("water_balance", station_id = "bryce_canyon_np", start_year = 2015,
            end_year = 2020, table_type = "monthly", soil_water = 100,
            pet_type = "hamon", forgiving = "very")

 # Import number of days annually with minimum temperatures below the 5th
 # percentile temperature and number of days above the 95th percentile
 import_extreme_temp(station_id = "tumacacori", start_year = 1991, end_year =
                     2020, station_type = "GHCN", year = "year")

 # Imports number of days annually with minimum and maximum daily
 # temperatures below and above user set temperatures
 import_below_above_temp(station_id = "tumacacori", start_year = 1991,
                         end_year =2020, tmin_temp = 20, tmax_temp = 100,
                         station_type = "GHCN", year = "year")



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