extract | R Documentation |
Extract methods for raadtools read functions
## S4 method for signature 'function,data.frame'
extract(x, y, ctstime = FALSE, fact = NULL, verbose = TRUE, ...)
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 ( |
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 |
verbose |
report on progress or keep quiet |
... |
Additional arguments passed to the read function. |
Extract data from read functions in various ways.
data values extracted by the read functions
readsst
and extract
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.