Learn R Programming

bfastSpatial (version 0.6.2)

zooExtract: Utility to extract a zoo object from a raster time-series

Description

This function extracts a zoo object from a multilayer raster object with time written to the z dimension or a date vector supplied externally. The aim of this utility is to facilitate the use of the bfmApp for bfastmonitor parameters investigation. The app allows the user to supply a zoo (time-series) object and visualize the effect of parameters change on the algorithm output. We outline in the vignette of the bfastSpatial package that this is an interesting step for parameter selection prior to more heavy processing when starting to work in a study area.

Usage

zooExtract(x, sample = "click", dates = NULL, file = NULL, ...)

Arguments

x

rasterBrick or rasterStack object, or file name to a multilayer raster object stored on disk.

sample

The point(s) to extract. Default to 'click' where a point is interactively choosen by clicking. Or any of object accepted by extract. (points represented by a two-column matrix or data.frame, or SpatialPoints*; SpatialPolygons*; SpatialLines; Extent; or a numeric vector representing cell numbers). For 'click', a layer of x needs to be plotted first.

dates

A date vector (optional, only if time is not yet contained in the z dimension of the raster object, or comprised in its layer names.)

file

character rds filename where to write the output.

...

Arguments to be passed to extract.

Value

A zoo object that may contain multiple time-series

See Also

sr2vi

Examples

Run this code
# NOT RUN {
# Single time-series selected interactively
data(tura)
plot(tura, 2)
zooExtract(x = tura, sample = 'click', file = file.path(tempdir(), 'zooClick.rds'))

# Then in order to explore the time series and the bfastmonitor parameters, run the following line
# }
# NOT RUN {
runGitHub("bfmApp", "dutri001")
# }
# NOT RUN {
# And upload the file zooClick.rds
# }

Run the code above in your browser using DataLab