Package 'ecochange'

Title: Integrating Ecosystem Remote Sensing Products to Derive EBV Indicators
Description: Essential Biodiversity Variables (EBV) are state variables with dimensions on time, space, and biological organization that document biodiversity change. Freely available ecosystem remote sensing products (ERSP) are downloaded and integrated with data for national or regional domains to derive indicators for EBV in the class ecosystem structure (Pereira et al., 2013) <doi:10.1126/science.1229931>, including horizontal ecosystem extents, fragmentation, and information-theory indices. To process ERSP, users must provide a polygon or geographic administrative data map. Downloadable ERSP include Global Surface Water (Peckel et al., 2016) <doi:10.1038/nature20584>, Forest Change (Hansen et al., 2013) <doi:10.1126/science.1244693>, and Continuous Tree Cover data (Sexton et al., 2013) <doi:10.1080/17538947.2013.786146>.
Authors: Wilson Lara Henao [aut, cre] , Victor Gutierrez-Velez [aut] , Ivan Gonzalez [ctb] , Maria C. Londono [ctb]
Maintainer: Wilson Lara Henao <[email protected]>
License: GPL-3
Version: 2.9.3.2
Built: 2024-11-09 04:08:08 UTC
Source: https://github.com/cran/ecochange

Help Index


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, 
    ...)

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

Value

tibble.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

## 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')

Ecosystem changes

Description

This function produces ecosystem-change maps by masking cell values in a layer of ecosystem changes over a target set of ecosystem variables. The function also allows focusing the ecosystem-change analysis on a species distribution range.

Usage

echanges(ps, eco = names(ps[[1:(nlayers(ps) - 
    1)]]), change = names(ps[[(nlayers(ps))]]), 
    sp_dist, eco_range = c(1, 
        100), change_vals = 1:19, 
    sp_dist_range = c(1, 
        1), spread = TRUE, 
    get_unaffected = TRUE, 
    binary_output = FALSE, 
    noDataValue = 0, 
    mc.cores = round(detectCores() * 
        0.6, 0), ...)

Arguments

ps

RasterStack or SpatialPolygonsDataFrame. Stack of spatial data, including the target ecosystem variables, a layer of changes, and an alternative layer of a species distribution range. This argument can also be a polygon geometry used to integrate such spatial data via implementation of rsp2ebv; see the ellipsis term below.

eco

character. Regular expression matching names of a subset of layers representing the target ecosystem variables. Default matches names of the first 1:(n-1) layers in ps.

change

character. Name of the layer of ecosystem changes. Default matches the name of the last layer in ps.

sp_dist

character. Name of an alternative layer representing a species distribution range. If missing then this argument is ignored.

eco_range

numeric. Range of values in the target ecosystem variable.

change_vals

numeric. Vector of values in the layer of ecosystem changes.

sp_dist_range

numeric. Range of values in the alternative layer of species. distribution range. This argument is ignored if sp_dist is missing.

spread

logical. Spread representation of ecosystem changes. Users do not need to change this argument. It is used by other rouines to fastening computation of ecosystem horizontal extents. If FALSE then the function mask cell values in the target ecosystem variables over over the layer of ecosystem changes. Default TRUE.

get_unaffected

logical. Extract unaffected areas. If FALSE then pixel values of the ecological variable across the changed areas are extracted. Default TRUE.

binary_output

logical. Produce binary outputs (masks). If FALSE then ranges of values of the ecological variable are maintained. Default FALSE.

noDataValue

numeric. Output NoDataValue. Default 0.

mc.cores

numeric. The number of cores. Default uses around 60 percent of the CPU capacity.

...

If ps is a polygon then additional arguments in rsp2ebv.

Value

Class echanges.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Jetz, W., McGeoch, M. A., Guralnick, R., Ferrier, S., Beck, J., Costello, M. J., ... & Meyer, C. (2019). Essential biodiversity variables for mapping and monitoring species populations. Nature Ecology & Evolution, 3(4), 539-551.

Hansen, M. C., Potapov, P. V., Moore, R., Hancher, M., Turubanova, S. A., Tyukavina, A., ... & Kommareddy, A. (2013). High-resolution global maps of 21st-century forest cover change. science, 342(6160), 850-853.

Pekel, J. F., Cottam, A., Gorelick, N., & Belward, A. S. (2016). High-resolution mapping of global surface water and its long-term changes. Nature, 540(7633), 418-422.

Pereira, H.M., Ferrier, S., Walters, M., Geller, G.N., Jongman, R.H.G., Scholes, R.J., Bruford, M.W., Brummitt, N., Butchart, S.H.M., Cardoso, A.C. and Coops, N.C., 2013. Essential biodiversity

Sexton, J. O., Song, X. P., Feng, M., Noojipady, P., Anand, A., Huang, C., ... & Townshend, J. R. (2013). Global, 30-m resolution continuous fields of tree cover: Landsat-based rescaling of MODIS vegetation continuous fields with lidar-based estimates of error. International Journal of Digital Earth, 6(5), 427-448. variables. Science, 339(6117), pp.277-278.

Examples

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

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

## Method 'plot.echanges' allows comparing rasters using a common scale bar:
plot.echanges(def)

Gauge Biodiversity Indicator

Description

This function processes ecosystem-change maps from echanges to calculate biodiversity indicators, including ecosystem extent, entropy, fractal dimension, among others. To sample the indicators across fixed-size grids see sampleIndicator.

Usage

gaugeIndicator(ps, ..., 
    metric = "area_ha", 
    smp_lsm = list(), 
    mc.cores = round(detectCores() * 
        0.6, 0))

Arguments

ps

SpatialPolygonsDataFrame or RasterStack. Polygon geometry used to produce ecosystem-change maps via the implementation of echanges or the stack of ecosystem-change maps.

...

If ps is a polygon then additional arguments in echanges or rsp2ebv.

metric

character. The name of an indicator. Default 'area_ha' computes ecosystem areas (ha) at class level. See the argument 'metric' in list_lsm to implement other metrics.

smp_lsm

list. List of arguments in calculate_lsm. This argument is ignored when metric = 'area_ha'.

mc.cores

numeric. The number of cores. Default uses around 60 percent of the cores.

Details

Coordinate reference system of the spatial units must have metric units UTM. Performance in the computation of ecosystem extents is optimized via the implementation of the function tabuleRaster. Indicators other than ecosystem extents are calculated implementing calculate_lsm.

Value

Class Indicator.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Hesselbarth, M. H., Sciaini, M., With, K. A., Wiegand, K., & Nowosad, J. (2019). landscapemetrics: an open source R tool to calculate landscape metrics. Ecography, 42(10), 1648-1657.

O'Connor, B., Secades, C., Penner, J., Sonnenschein, R., Skidmore, A., Burgess, N. D., & Hutton, J. M. (2015). Earth observation as a tool for tracking progress towards the Aichi Biodiversity Targets. Remote sensing in ecology and conservation, 1(1), 19-28.

Pereira, H.M., Ferrier, S., Walters, M., Geller, G.N., Jongman, R.H.G., Scholes, R.J., Bruford, M.W., Brummitt, N., Butchart, S.H.M., Cardoso, A.C. and Coops, N.C., 2013. Essential biodiversity variables. Science, 339(6117), pp.277-278.

Skidmore, A. K., & Pettorelli, N. (2015). Agree on biodiversity metrics to track from space: Ecologists and space agencies must forge a global monitoring strategy. Nature, 523(7561), 403-406.

Examples

## 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) in the 'amazon'
## brick are computed:
def <- echanges(amazon, eco = 'TC',
                change = 'lossyear',
                eco_range = c(1,80),
                get_unaffected = TRUE,
                binary_output = FALSE,
                mc.cores = 2)

## Function 'gaugeIndicator' is used to compute ecosystem areas
## (default):
am_areas <- gaugeIndicator(def,
                           mc.cores = 2)

plot.Indicator(am_areas)

Get Geographic Adminitrative Unit

Description

This function can retrieve Geographic Administrative Data Maps (GADM).

Usage

getGADM(unit.nm = NULL, 
    level = 2, country = "COL", 
    ext = "json", path = tempdir())

Arguments

unit.nm

character or NULL. Name of Geographic Administrative Data Map (e.g., municipality), or the name of such an unit plus its corresponding higher-level unit (e.g., department/state). If NULL then a list of administrative subdivisions is printed.

level

numeric. A number between zero and two, indicating any of the levels of administrative subdivisions (0=country, 1=first administrative subdivision, and 2=second administrative subdivision).

country

character. ISO code specifying a country. Default 'COL'.

ext

character. File extension of the retrieved data file. Default 'json'.

path

character. Path name indicating where the unit will be stored. Default stores the data in a temporary directory.

Value

SpatialPolygonsDataFrame or character vector of GADM units..

Author(s)

Wilson Lara Henao <[email protected]> [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>)

References

https://gadm.org/

Examples

## Printing municipalities of Colombia:

     
         muni <- getGADM(NA)
         head(muni)

Get remote sensing product

Description

This function processes the extent of a predefined region of interest (polygon geometry or GADM unit) to download ecosystem remote sensing products (ERSP). Downloadable ERSP include Global Surface Water, Forest Change, and Continuous Tree Cover data. See listGP.

Usage

getrsp(roi = NULL, ..., 
    lyrs = NULL, path, 
    rewrite.pass = FALSE, 
    verify.web = FALSE, 
    mc.cores = round(detectCores() * 
        0.6, 0))

Arguments

roi

SpatialPolygonsDataFrame; or sf; or character; or NULL. Region of interest. This can be either 1) a polygon geometry; or 2) the name of a GADM unit (see getGADM); or 3) a NULL value. Default NULL makes the function to print a list of GADM units.

...

If roi is a GADM unit then additional arguments in getGADM.

lyrs

character. Remote-sensing products. Default NULL makes the function to print a list of Downloadable data, see listGP.

path

character. Path name indicating where the variables are stored. If missing then a folder named as 'ecochange' created in a current temporary directory is used.

rewrite.pass

logical. Rewrite password. Only valid to download new NASA Earth data, see details section.

verify.web

logical. Verify in the web whether the URLs used to download the rsp are available. See getOption('webs'). Default FALSE.

mc.cores

numeric. The number of cores. Default uses around 60 percent of the cores.

Details

Downloads of Continuous Tree Cover data require user authentication through the NASA Earth data Login. To obtain a NASA Earth data Login account, please visit: https://urs.earthdata.nasa.gov/users/new.

Value

Path names of the remote sensing products just retrieved, or character vectors suggesting GADM units/Global Products that can be used to download ERSP (see NULL defaults in arguments 'roi' and 'lyrs').

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Pekel, J. F., Cottam, A., Gorelick, N., & Belward, A. S. (2016). High-resolution mapping of global surface water and its long-term changes. Nature, 540(7633), 418-422.

Hansen, M. C., Potapov, P. V., Moore, R., Hancher, M., Turubanova, S. A., Tyukavina, A., ... & Kommareddy, A. (2013). High-resolution global maps of 21st-century forest cover change. science, 342(6160), 850-853.

Sexton, J. O., Song, X. P., Feng, M., Noojipady, P., Anand, A., Huang, C., ... & Townshend, J. R. (2013). Global, 30-m resolution continuous fields of tree cover: Landsat-based rescaling of MODIS vegetation continuous fields with lidar-based estimates of error. International Journal of Digital Earth, 6(5), 427-448.

Examples

## Polygon of the Colombian municipality of Cartagena del Chaira:
    load(system.file('cchaira_roi.RData',package = 'ecochange'))

## A Global Surface Water layer ('seasonality') which covers the
## extent of the polygon is retrieved:

 
 rsp_cchaira <- getrsp(cchaira_roi,
   lyrs = 'seasonality', mc.cores = 2, path = tempdir())
 file.exists(rsp_cchaira)

Get WRS

Description

This function processes regions of interest (a polygon geometry or GADM unit) to find corresponding Landsat Path/Row World Reference System (WRS) polygons. This function is internally implemented by getrsp

Usage

getWRS(roi = NULL, path = tempdir(), 
    ...)

Arguments

roi

SpatialPolygonsDataFrame; or character; or NULL. Region of interest. This can be whether 1) a polygon geometry; or 2) the name of a GADM unit (see getGADM); or 3) a NULL value. Default NULL makes the function to print a list of GADM units.

path

character. Path name indicating where the WRS data are processed.

...

Additional arguments in getGADM.

Value

SpatialPolygonsDataFrame, or set of GADM units.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

load(system.file('cchaira_roi.RData',package = 'ecochange'))
 
 wrs_cchaira <- getWRS(cchaira_roi)
     plot(wrs_cchaira)

List of global products

Description

This function prints information about ecosystem remote sensing products that can be downloaded with getrsp.

Usage

listGP(layer = TRUE, 
    Algorithm = TRUE, 
    author = TRUE, funs = FALSE, 
    api.code = FALSE)

Arguments

layer

character. Add column 'layer' to the data.

Algorithm

character. Add column 'Algorithm' to the data.

author

character. Add column 'author' to the data.

funs

character. Add column 'funs' to the data.

api.code

character. Add column 'api.code' to the data.

Value

tibble.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Pekel, J. F., Cottam, A., Gorelick, N., & Belward, A. S. (2016). High-resolution mapping of global surface water and its long-term changes. Nature, 540(7633), 418-422.

Hansen, M. C., Potapov, P. V., Moore, R., Hancher, M., Turubanova, S. A., Tyukavina, A., ... & Kommareddy, A. (2013). High-resolution global maps of 21st-century forest cover change. science, 342(6160), 850-853.

Sexton, J. O., Song, X. P., Feng, M., Noojipady, P., Anand, A., Huang, C., ... & Townshend, J. R. (2013). Global, 30-m resolution continuous fields of tree cover: Landsat-based rescaling of MODIS vegetation continuous fields with lidar-based estimates of error. International Journal of Digital Earth, 6(5), 427-448.

Examples

lst <- listGP()

Visualize EBVstats objects

Description

Plots for objects from EBVstats are printed.

Usage

## S3 method for class 'EBVstats'
plot(x, y, ...)

Arguments

x

tibble. Data set of statistics such as that produced by EBVstats.

y

character. Color scale. If missing then grDevices::terrain.colors(n), where n is the number of layers, is implemented.

...

Graphical arguments:

  • cex: adjustment of sizes for most text values,

  • xlab, and ylab: titles for the x and y axes,

  • main: a text of the main title,

  • sub: a text for the sub title,

  • labels: a string or numeric sequence for the x-axis labels,

  • fill: a text for the legend title

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

## 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 = 'Municipality: Cartagena del Chaira',
               fill = 'Layer')

Visualize ecosystem changes

Description

This function can display level and box plots for objects from rsp2ebv, echanges, or sampleIndicator.

Usage

## S3 method for class 'echanges'
plot(x, y, ...)

Arguments

x

Raster*, or echanges. RasterStack object or ecoystem-change representation.

y

character. A color palette. If this is missing or the suggest viridis is not installed then terrain.colors is implemented.

...

Graphical arguments:

  • type: what type of plot should be drawn: "p" for level plots (default), or "b" for box plots,

  • cex: adjustment of sizes for most text values. If missing then cex = 1; if a main title is specified then it is increased 1.4*cex,

  • xlab, and ylab: titles for the x and y axes,

  • main: a text of the main title,

  • labels: a string or numeric sequence for the panel titles

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

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

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

plot.echanges(def)

Visualize Indicator objects

Description

Plots for objects from gaugeIndicator are produced.

Usage

## S3 method for class 'Indicator'
plot(x, y, 
    ...)

Arguments

x

tibble. Data set of indicators such as that produced by gaugeIndicator.

y

character. A color palette. If this is missing or the suggest viridis is not installed then terrain.colors is implemented.

...

Graphical arguments:

  • type: what type of plot should be drawn: "s" for stacked bar plots (default), or "b" for box plots,

  • cex: adjustment of sizes for most text values,

  • xlab, and ylab: titles for the x and y axes,

  • main: a text of the main title,

  • sub: a text for the sub title,

  • labels: a string or numeric sequence for the x-axis labels,

  • fill: a text for the legend title

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

## 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 'gaugeIndicator' is used to compute ecosystem areas
## (default metric = 'area_ha'):
am_areas <- gaugeIndicator(def,
                         mc.cores = 2)

## A plot of the 'am_areas' object
plot.Indicator(am_areas,
               cex = 1.5,
               xlab = 'Year',
               ylab = 'Area (ha)',
               main = 'Ecosystem changes',
               sub = 'Northern amazon',
               fill = 'Forest cover (%)')

Integrate remote sensing products

Description

This function integrates ecosystem remote sensing products and produces raster-data sections with the cell values enclosed in a region of interest.

Usage

rsp2ebv(ps = NULL, ..., 
    lyrs = NULL, path, 
    sr, ofr = c(30, 30), 
    mc.cores = round(detectCores() * 
        0.6, 0))

Arguments

ps

SpatialPolygonsDataFrame; or sf; or character; or NULL. Region of interest. This can be whether 1) a polygon geometry; or 2) the name of a GADM unit (see getGADM); or 3) a NULL value. Default NULL makes the function to print a list of GADM units.

...

Additional arguments in getGADM and getrsp.

lyrs

character. Remote-sensing products. Default NULL makes the function to print a list of Downloadable data, see listGP.

path

character. Path name indicating where the variables are stored. If missing then a folder named as 'ecochange' created in a current temporary directory is used.

sr

character. PROJ.4 description of the target coordinate reference system. If missing then the target layers are projected to metric system UTM.

ofr

numeric. c(xres,yres). Output file resolution (in target georeferenced units). Default c(30,30) m2.

mc.cores

numeric. The number of cores. Default uses around 60 percent of the cores.

Details

This function implements 'sf::gdal_utils' so it assumes the user's machine has a valid GDAL installation.

Value

Class echanges.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Jetz, W., McGeoch, M. A., Guralnick, R., Ferrier, S., Beck, J., Costello, M. J., ... & Meyer, C. (2019). Essential biodiversity variables for mapping and monitoring species populations. Nature Ecology & Evolution, 3(4), 539-551.

O'Connor, B., Secades, C., Penner, J., Sonnenschein, R., Skidmore, A., Burgess, N. D., & Hutton, J. M. (2015). Earth observation as a tool for tracking progress towards the Aichi Biodiversity Targets. Remote sensing in ecology and conservation, 1(1), 19-28.

Skidmore, A. K., & Pettorelli, N. (2015). Agree on biodiversity metrics to track from space: Ecologists and space agencies must forge a global monitoring strategy. Nature, 523(7561), 403-406.

Examples

## A Global Surface Water layer ('seasonality') covering the extent of a
## Colombian municipality Cartagena del Chaira is formated into an
## spatial EBV:
        load(system.file('cchaira_roi.RData',package = 'ecochange'))

 
 rsp_cchaira <- getrsp(cchaira_roi,
   lyrs = 'seasonality', mc.cores = 2, path = tempdir())

 file.exists(rsp_cchaira)

 season_cchaira <- rsp2ebv(cchaira_roi,
                               lyrs = 'seasonality', path = tempdir())

Sample Biodiversity indicator

Description

This function divides into fixed-size grids each of the scenes of a stack of ecosystem-spatial data and samples a biodiversity indicator by every grid. To compute biodiversity indicators at the class and landscape levels, see gaugeIndicator

Usage

sampleIndicator(ps = NULL, 
    ..., metric = "condent", 
    classes = 5, min = 1, 
    max = 100, side, 
    smp_lsm = list(level = "landscape"), 
    mc.cores = round(detectCores() * 
        0.6, 0))

Arguments

ps

SpatialPolygonsDataFrame or RasterStack. Polygon geometry used to produce ecosystem-change maps via the implementation of echanges or the stack of ecosystem-change maps.

...

If ps is a polygon then additional arguments in echanges or rsp2ebv.

metric

character. The name of an indicator other than ecosystem extent. This can be cohesion ('cohesion'), conditional entropy ('condent'), perimeter-area fractal dimension ('pafrac'), among others, see package list_lsm. Default 'condent'.

classes

numeric; or NULL. Number of evenly spaced classes used to reclassify the layers. Default 5. If NULL then the layers are not reclassified.

min

numeric. If classes != NULL then minimum cell value in the layers. Default 1

max

numeric. If classes != NULL then maximum cell value in the layers. Default 100

side

numeric. Side of the sampling grid (m). If missing the function tries to find a grid size the samples at least a grid with a non-NA value of the indicator.

smp_lsm

List. Additional arguments in sample_lsm

mc.cores

numeric. The number of cores. Default uses 60 percent of the cores.

Value

Class echanges

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

References

Hesselbarth, M. H., Sciaini, M., With, K. A., Wiegand, K., & Nowosad, J. (2019). landscapemetrics: an open source R tool to calculate landscape metrics. Ecography, 42(10), 1648-1657.

O'Connor, B., Secades, C., Penner, J., Sonnenschein, R., Skidmore, A., Burgess, N. D., & Hutton, J. M. (2015). Earth observation as a tool for tracking progress towards the Aichi Biodiversity Targets. Remote sensing in ecology and conservation, 1(1), 19-28.

Skidmore, A. K., & Pettorelli, N. (2015). Agree on biodiversity metrics to track from space: Ecologists and space agencies must forge a global monitoring strategy. Nature, 523(7561), 403-406.

Examples

## 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) in the 'amazon'
## brick are computed:
def <- echanges(amazon, eco = 'TC',
                change = 'lossyear',
                eco_range = c(1,80),
                get_unaffected = TRUE,
                binary_output = FALSE,
                mc.cores = 2)


plot.echanges(amazon)

## Function 'sampleIndicator' is implemented to sample a metric of
## conditional entropy (default):

    def_condent <- sampleIndicator(def, side = 400, mc.cores = 2)

plot.echanges(def_condent, cex = 1.5)

Fast tabulation of pixel values

Description

This function generates frequency tables for scenes in ecosystem remote sensing products by wrapping rasterDT. The function is mapped by gaugeIndicator to optimize computation of ecoystem extents.

Usage

tabuleRaster(layer = "", 
    del0 = TRUE, useNA = "no", 
    n256 = FALSE)

Arguments

layer

character. File path to an ERSP scene.

del0

logical. Remove the 0-count categories.

useNA

logical. Include NA values. This argument is passed to rasterDT::freqDT.

n256

logical. Do the raster contains less than 256 unique values?

Value

data.frame.

Author(s)

Wilson Lara Henao <[email protected]> [aut, cre], Victor Gutierrez-Velez [aut], Ivan Gonzalez [ctb], Maria C. Londono [ctb]

Examples

tabuleRaster(raster(volcano), n256 = FALSE)