slope_rast | R Documentation |
calculate slope of rast object
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))
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
|
A terra rast object, with bands of slope
and pvalue
.
terra::rast()
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.