Description Usage Arguments Details Value See Also Examples
Temporal linear interpolation of environmental data using a raster, SpatialPointsDataFrames or matrix/data.frame.
1 2 3 4 5 6 7 8 |
x |
Object of class RasterStack, RasterBrick or data.frame. |
x.dates |
Object of class Date with dates of x. |
y |
Object of class Date with target dates. Alternatively, a RasterStack or RasterBrick with julian days for each pixel. |
time.buffer |
A two-element vector with temporal search buffer (expressed in days). |
smooth |
Logical argument. Default is TRUE. |
smooth.fun |
Smoothing function. uses |
Wrapper for the function intime
that performs a time-sensitive, linear interpolation
of a multi-band raster. The output dates are specified by y and can differ from the dates of the input,
specified by x.dates. time.buffer controls the search for dates to interpolate from specifying
the maximum number of days that the selected data points can differ from the target date(s) in y.
time.buffer is provided as a two element vector which limits the search in the past and future. If
smooth is TRUE, the function will also smooth the interpolated time series. fun determines
which function to use. By default, runmean2
is used whcih is an NA-sensitive, c++ implementation
of a simple running mean.
A RasterBrick or a data frame. If a RasterBrick, each layer represents a date in y. If a data.frame/matrix, columns represent dates and rows represent samples.
dataQuery
timeDir
spaceDir
moveSeg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {
require(raster)
#' # read raster data
file <- list.files(system.file('extdata', '', package="rsMove"), 'ndvi.tif', full.names=TRUE)
r.stk <- stack(file)
r.stk <- stack(r.stk, r.stk, r.stk) # dummy files for the example
# read movement data
data(shortMove)
# raster dates
file.name <- names(r.stk)
x.dates <- as.Date(paste0(substr(file.name, 2, 5), '-',
substr(file.name, 7, 8), '-', substr(file.name, 10, 11)))
# interpolate raster data to target dates
out <- imgInt(r.stk[1:50,1:50,drop=FALSE], x.dates, as.Date("2013-08-10"), c(60,60))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.