Generates a spatial and/or temporal subset of procedure data

# S4 method for MeteorologyUncorrectedData
subsample(object, bbox = NULL, stations = NULL, dates = NULL, buffer = 0)
# S4 method for MeteorologyInterpolationData
subsample(object, bbox = NULL, stations = NULL, dates = NULL, buffer = 0)

Arguments

object

An object of a sub-class MeteorologyProcedureData-class.

bbox

A 2x2 numeric matrix with the boundaries of the target area. If NULL, the original boundary box is kept (except if stations is specified).

stations

A numeric, character or logical vector specifying a subset of weather stations. If NULL all original weather stations are kept (except if bbox is specified).

dates

A vector of Date with the subset of dates of interest. If NULL, all dates are kept.

buffer

A buffer to put around bbox for the spatial selection of data.

Value

An object of the same class as object.

Methods

subsample

signature(object = "MeteorologyUncorrectedData"): Generates a MeteorologyUncorrectedData object for a smaller area and a subset of dates.

subsample

signature(object = "MeteorologyInterpolationData"): Generates a MeteorologyInterpolationData object for a smaller area and a subset of dates.

Examples

data(exampleinterpolationdata)

oridates = exampleinterpolationdata@dates

#Interpolation data using the first ten dates (same boundary box)
subdata = subsample(exampleinterpolationdata, dates = oridates[1:10])
#> Warning: 24 stations had no data after subsetting and were removed.