get_graphab_raster_codes: Get unique raster codes from a Graphab project

View source: R/get_graphab_raster_codes.R

get_graphab_raster_codesR Documentation

Get unique raster codes from a Graphab project

Description

The function extracts unique raster codes from a Graphab project

Usage

get_graphab_raster_codes(proj_name, mode = "all", proj_path = NULL)

Arguments

proj_name

A character string indicating the Graphab project name. The project name is also the name of the project directory in which the file proj_name.xml will be created.

mode

A character string equal to either 'all' (default) or 'habitat' indicating whether the returned codes are all the codes of the source raster used for creating the project or only the code corresponding to the habitat patches.

proj_path

(optional) A character string indicating the path to the directory that contains the project directory. It should be used when the project directory is not in the current working directory. Default is NULL. When 'proj_path = NULL', the project directory is equal to getwd().

Value

The function returns a vector of integer values corresponding to the source raster codes (all the codes or only the one corresponding to habitat patches).

Author(s)

P. Savary

Examples

## Not run: 
proj_name <- "grphb_ex"
get_graphab_raster_codes(proj_name = proj_name,
               mode = "all")

## End(Not run)

graph4lg documentation built on Feb. 16, 2023, 5:43 p.m.