get_climate_data: Get Monthly Climatological Data from a Local Data Set or from...

get_climate_dataR Documentation

Get Monthly Climatological Data from a Local Data Set or from the Internet

Description

Loads climatological data from a saved data set or downloads and saves it directly from the Internet.

Usage

get_climate_data(
  download = FALSE,
  data_dir,
  filename_base,
  urls = climeseries::data_urls,
  omit = omitUrlNames,
  only = NULL,
  baseline = TRUE,
  annual_mean = FALSE,
  verbose = TRUE
)

Arguments

download

Logical: if TRUE, download the latest instrumental data from the Internet; if FALSE, load the most recent instrumental data set from the default data directory.

data_dir

The path of the primary directory for storing downloaded instrumental temperature data. The default is a global value defined in the file "constants.R".

filename_base

The starting filename for climate-series data files, to which "raw_" and/or a date representation will be appended.

urls

A list of named URLs pointing to instrumental data online; the default is a global value defined in the package file "constants.R".

baseline

An integer year or, more typically, range of years on which the temperature anomalies will be centered. If NULL, no baseline centering is done, and the string "raw_" will be appended to filename_base before the instrumental data is saved or loaded.

verbose

Logical; passed to DownloadInstrumentalData.

Value

A data frame containing monthly climatological data sets with the following columns:

year

The year CE.

met_year

The "meteorological year" starting the previous December.

yr_part

Monthly midpoint as a fraction of a year, i.e. (month - 0.5)/12.

month

Month of the year as an integer value.

BEST

Berkeley Earth Surface Temperature (BEST) global average combined land+SST temperature anomaly.

BEST_uncertainty

BEST 95% confidence interval of uncertainty in the temperature anomaly.

Cowtan & Way Hybrid

Cowtan & Way hybrid reconstruction of HadCRUT4 global average combined land+SST temperature anomaly. (See dx.doi.org/10.1002/qj.2297.)

Cowtan & Way Hybrid_uncertainty

Cowtan & Way hybrid 95% confidence interval of uncertainty in the temperature anomaly.

GISTEMP

Goddard Institute for Space Studies (GISS) global average combined land+SST temperature anomaly.

GISTEMP NH

GISS northern hemisphere average combined land+SST temperature anomaly.

GISTEMP SH

GISS southern hemisphere average combined land+SST temperature anomaly.

HadCRUT4

UK Met Office Hadley Centre global average combined land+SST temperature anomaly.

HadCRUT4 NH

UK Met Office Hadley Centre northern hemisphere average combined land+SST temperature anomaly.

HadCRUT4 SH

UK Met Office Hadley Centre southern hemisphere average combined land+SST temperature anomaly.

HadCRUT4 Tropics

UK Met Office Hadley Centre tropics (30Sā€“30N latitude) average combined land+SST temperature anomaly.

JMA

Japan Meteorological Agency (JMA) global average combined land+SST temperature anomaly.

Keeling

Scripps Institution of Oceanography CO2 measurements at Mauna Loa.

NCEI

U.S. National Centers for Environmental Information (NCEI) global average combined land+SST temperature anomaly.

NCEP Surface Air

National Centers for Environmental Prediction (NCEP) NCEP/NCAR reanalysis estimate of global average surface air temperature.

NCEP Surface Air NH

NCEP/NCAR reanalysis estimate of northern hemisphere average surface air temperature.

NCEP Surface Air SH

NCEP/NCAR reanalysis estimate of southern hemisphere average surface air temperature.

RATPAC-A 850-300 mb

NOAA's Radiosonde Atmospheric Temperature Products for Assessing Climate (RATPAC) global average tropospheric temperature anomaly (850ā€“300 mb).

RSS TLT 3.3

Remote Sensing Systems (RSS) Temperature Lower Troposphere (TLT) global average temperature anomaly (v. 3.3).

RSS TMT 3.3

RSS Temperature Middle Troposphere (TMT) global average temperature anomaly (v. 3.3).

RSS TMT 4.0

RSS Temperature Middle Troposphere (TMT) global average temperature anomaly (v. 4.0).

UAH TLT 5.6

University of Alabama in Huntsville (UAH) Temperature Lower Troposphere (TLT) global average temperature anomaly (v. 5.6).

UAH TLT 6.0

University of Alabama in Huntsville (UAH) Temperature Lower Troposphere (TLT) global average temperature anomaly (v. 6.0).

Examples

## Not run: 
## Download both centered and "raw" data.

d <- get_climate_data(download=TRUE, baseline=TRUE)

## Load both centered and "raw" data.

d <- get_climate_data(download=FALSE, baseline=TRUE)
e <- get_climate_data(download=FALSE, baseline=FALSE)

## Which year is the warmest?

inst <- get_climate_data(download=FALSE, baseline=TRUE)
series <- setdiff(names(inst), c(climeseries::common_columns, c("CO2 Mauna Loa")))
yearType <- "year" # "year" or "met_year" = meteorological year.
annual <- sapply(series, function(s) { rv <- tapply(inst[[s]], inst[[yearType]], mean, na.rm=TRUE); rv <- rv[!is.nan(rv)]; rv })

## How many months for last year have data?
lastYear <- as.integer(format(Sys.Date(), "%Y")) - 1
sapply(inst[inst[[yearType]] %in% lastYear, series], function(s) sum(!is.na(s)))
mapply(function(x, y) x[y][1L], annual, sapply(annual, function(s) { order(s, decreasing=TRUE) }))

## Calculate max. anomaly for years not in 'excludeDate'. (Allows exclusion of e.g. partial current year.)
excludeDate <- as.integer(format(Sys.Date(), "%Y")) # Or excludeDate <- c(2016)
annualLt <- sapply(annual, function(s) { s[!(as.numeric(names(s)) %in% excludeDate)] })
mapply(function(x, y) x[y][1L], annualLt, sapply(annualLt, function(s) { order(s, decreasing=TRUE) }))

## End(Not run)


priscian/climeseries documentation built on Aug. 17, 2024, 3:13 p.m.