mapTrend: Convert a series of phenology terra::raster files to a single...

View source: R/mapTrend.R

mapTrendR Documentation

Convert a series of phenology terra::raster files to a single long-term trend terra::raster.

Description

Convert a series of phenology terra::raster files to a single long-term trend terra::raster.

Usage

mapTrend(
  File_List,
  Year_List,
  parallel = FALSE,
  n.cores = NULL,
  verbose = FALSE
)

Arguments

File_List

List of phenology terra::raster files (i.e. those produced in 'mapPheno')

Year_List

Vector of Integer Year (YYYY) with length > 5

parallel

TRUE or FALSE (Default = FALSE) if TRUE, use parallel backend through plyr::aaply

n.cores

Integer number of cores to be used for parallel processing (only use if parallel = TRUE)

verbose

TRUE or FALSE (Default = FALSE)

Value

terra::raster object with extent=ext(rast(File_List)[1]) and CRS = crs(rast(File_List)[1]). Layer 1 is the slope estimate of the linear model relating green-up timing (Day of Year) to time (Year). Layer 2 is the p-value of the slope estimate. Layer 3 is the standard error of the slope estimate. Layer 4 is the r-squared value for the linear model.

Examples


## Not run: 

fpath <- system.file("extdata", package="phenomap")
File_List.Trend <- paste(fpath, list.files(path = fpath, pattern=c("Sample_Greenup_")), sep="/")

Year_List <- 2011:2016 # Tell it what years you're using
n.cores <- 4 # Set up parallel computing

phenotrend <- mapTrend(File_List = File_List.Trend,
                             Year_List = Year_List,
                             parallel = TRUE,
                             n.cores = n.cores,
                             verbose=TRUE)


## End(Not run)

phenomap documentation built on Oct. 13, 2023, 1:12 a.m.

Related to mapTrend in phenomap...