cruts2poly: cruts2poly function

Description Usage Arguments Details Value Examples

View source: R/import-export.R

Description

A function to convert Climatic Research Unit Time-Series in NetCDF format to polygonal format, averaging over each region in question.

Usage

1
2
3
4
5
6
7
cruts2poly(
  ncfile,
  poly,
  timeRange = NULL,
  offset = "1900-01-01",
  na.rm = FALSE
)

Arguments

ncfile

character string giving name and location of the CRUTS time series NetCDF file (if the file you downloaded is zipped, then you will need to extract it)

poly

a SpatialPolygonsDataFrame on which to average the variable in question

timeRange

vector of length 2 giving the start and end dates in the first and second place. Dates are converted using the function ymd, please refer to the help for this funciton for details on appropriate formats.

offset

time offset for CRU TS data

na.rm

logical, whether to ignore NA's in averaging, default is FALSE (to be consistent with other R functions in other packages), but option TRUE should probably be used on most occasions

Details

Data can be obtained from http://catalogue.ceda.ac.uk/uuid/ac4ecbd554d0dd52a9b575d9666dc42d

Value

a polygon with the averaged climate variable

Examples

1
## Not run: crutsimport(ncfile="my_cruts_file.nc",timeRange=c("2000-01-01","2001-01-01"))

Example output



cruts documentation built on March 13, 2020, 9:09 a.m.