Learn R Programming

ecochange (version 2.9.3.3)

EBVstats: EBV Stats

Description

This function is a wrapper of cellStats used to compute statistics for spatial indicators in the EBV class ecosystem structure. To derive the spatial indicators see functions echanges and sampleIndicator

Usage

EBVstats(ccp, stats, 
    ...)

Value

tibble.

Arguments

ccp

echanges, or RasterStack or NULL. If NULL then NULL is returned.

stats

character. vector of stats defined in cellStats. If missing then six summary statistics, including 'mean', 'sd', 'min', 'max', are computed.

...

Additional arguments in cellStats.

Author

Wilson Lara Henao [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Victor Gutierrez-Velez [aut] (<https://orcid.org/0000-0003-1338-2020>), Ivan Gonzalez [ctb] (<https://orcid.org/0000-0002-0313-398X>), Maria C. Londono [ctb] (<https://orcid.org/0000-0002-2317-5503>)

Examples

Run this code
## RasterBrick of structural Essential Biodiversity Variables
## covering the extent of a location in the northern Amazon basin
## (Colombia) is imported:
path. <- system.file('amazon.grd',package = 'ecochange')
amazon <- brick(path.)

## Changes in layers of tree-canopy cover (TC) are computed by
## processing the 'amazon' brick:
def <- echanges(amazon, eco = 'TC',
                change = 'lossyear',
                eco_range = c(1,80),
                get_unaffected = TRUE,
                binary_output = FALSE,
                mc.cores = 2)

## Function 'EBVstats' is used to compute ecosystem statistics
st_amazon <- EBVstats(def)

## A plot of the 'st_amazon' object
plot.EBVstats(st_amazon,
               cex = 1.5,
               xlab = 'Year',
               ylab = 'Canopy cover (%)',
               main = 'Ecosystem changes',
               sub = 'Northern Amazon',
               fill = 'Layer')

Run the code above in your browser using DataLab