slope_rast {rtrend} | R Documentation |
calculate slope of rast object
Description
calculate slope of rast object
Usage
slope_rast(
r,
period = c(2001, 2020),
outfile = NULL,
fun = rtrend::slope_mk,
...,
overwrite = FALSE,
.progress = "text"
)
rast_filter_time(r, period = c(2001, 2020))
Arguments
r |
A yearly rast object, which should have time attribute |
period |
|
outfile |
The path of outputed tiff file. If specified, |
fun |
the function used to calculate slope, see |
... |
other parameters ignored |
overwrite |
logical. If |
.progress |
name of the progress bar to use, see
|
Value
A terra rast object, with bands of slope
and pvalue
.
See Also
Examples
library(rtrend)
library(terra)
f <- system.file("rast/MOD15A2_LAI_China_G050_2001-2020.tif", package = "rtrend")
r <- rast(f)
r
time(r)
slp <- slope_rast(r,
period = c(2001, 2020),
outfile = "LAI_trend.tif", overwrite = TRUE,
fun = rtrend::slope_mk, .progress = "none"
)
# if you want to show progress, set `.progress = "text"`
slp
plot(slp)
file.remove("LAI_trend.tif")
[Package rtrend version 0.1.5 Index]