get_climate_data | R Documentation |
Loads climatological data from a saved data set or downloads and saves it directly from the Internet.
get_climate_data(
download = FALSE,
data_dir,
filename_base,
urls = climeseries::data_urls,
omit = omitUrlNames,
only = NULL,
baseline = TRUE,
annual_mean = FALSE,
verbose = TRUE
)
download |
Logical: if |
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 |
verbose |
Logical; passed to |
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). |
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.