extract: extract

extractR Documentation

extract

Description

Extract methods for raadtools read functions

Usage

## S4 method for signature 'function,data.frame'
extract(x, y, ctstime = FALSE, fact = NULL, verbose = TRUE, ...)

Arguments

x

A raadtools read function.

y

Object to use for querying from the raadtools read functions, such as a vector of character, Date, or POSIXt values, data.frame, trip, etc.

ctstime

specify whether to find the nearest value in time (FALSE), or interpolate between slices (TRUE)

fact

integer. Aggregation factor expressed as number of cells in each direction (horizontally and vertically). Or two integers (horizontal and vertical aggregation factor). See Details in aggregate

verbose

report on progress or keep quiet

...

Additional arguments passed to the read function.

Details

Extract data from read functions in various ways.

Value

data values extracted by the read functions

See Also

readsst and extract

Examples


a <- structure(list(x = c(174, 168, 156, 111, 99, 64, 52, 46, -4,
-15, -30, -38, -47, -62, -87, -127, -145, -160, -161), y = c(-72,
-39, -50, -58, -35, -38, -48, -60, -48, -35, -37, -51, -68, -72,
-69, -54, -40, -49, -54)), .Names = c("x", "y"), row.names = c(NA,
-19L), class = "data.frame")

a$time <- structure(c(5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479,
5479, 5479, 5489, 5529, 5529, 5529, 5579, 5579, 5579, 5579), class = "Date")
extract(readsst, a)
extract(readsst, a, method = "bilinear")
a$time <-  sort(as.Date("2005-01-01") + sample(c(0, 0, 0, 8, 20, 50), nrow(a), replace = TRUE))
extract(readsst, a)

AustralianAntarcticDivision/raadtools documentation built on Nov. 14, 2024, 4:27 p.m.