link_compar: Compare two link sets created in a Graphab project

View source: R/link_compar.R

link_comparR Documentation

Compare two link sets created in a Graphab project

Description

The function compares two link sets created in a Graphab project both quantitatively and spatially.

Usage

link_compar(
  proj_name,
  linkset1,
  linkset2,
  buffer_width = 200,
  min_length = NULL,
  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 is. It can be created with graphab_project

linkset1

A character string indicating the name of the first link set involved in the comparison. The link set has to be present in the project and can be created with graphab_link.

linkset2

A character string indicating the name of the second link set involved in the comparison. The link set has to be present in the project and can be created with graphab_link.

buffer_width

(default=200) An integer or numeric value indicating the width of the buffer created in each side of the links prior to spatial intersection. It is expressed in meters.

min_length

(optional, default=NULL) An integer or numeric value indicating the minimum length in meters of the links to be compared. Links whose length is larger than min_length will be ignored in the comparison.

proj_path

(optional, default=NULL) 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().

Details

The function compares two link sets linking the same habitat patches of the Graphab project but computed using different cost scenarios. It creates a buffer in each side of every link and then overlaps every link in linkset1 with the same link in linkset2. It returns the area of both buffered links and the area of their intersection. It also computes the Mantel correlation coefficient between the cost distances associated to the same links in both linksets.

Author(s)

P. Savary

Examples

## Not run: 
link_compar(proj_name = "grphb_ex",
              linkset1 = "lcp1",
              linkset2 = "lcp2"
              buffer_width = 200)

## End(Not run)

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