mergeTime | R Documentation |
Combine SpatRasters with partly overlapping time-stamps to create a single time series. If there is no overlap between the SpatRasters there is no point in using this function (use c
instead).
Also note that time gaps are not filled. You can use fillTime
to do that.
## S4 method for signature 'SpatRasterDataset'
mergeTime(x, fun=mean, filename="", ...)
x |
SpatRasterDataset |
fun |
A function that reduces a vector to a single number, such as |
filename |
character. Output filename |
... |
list with named options for writing files as in |
SpatRaster
r <- rast(system.file("ex/logo.tif", package="terra"))
s1 <- c(r, r)
time(s1) <- as.Date("2001-01-01") + 0:5
s1 <- s1/10
time(s1) <- as.Date("2001-01-07") + 0:5
s2 <- s1*10
time(s2) <- as.Date("2001-01-05") + 0:5
x <- sds(s1, s1, s2)
m <- mergeTime(x, mean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.