Description Usage Arguments Details Value Note Author(s) References See Also

View source: R/pairwiseRangemaps.R

This function takes a set of rangemaps and returns a matrix containing the areas of their pairwise intersections; optionally, also their individual areas and pairwise unions.

1 2 3 | ```
pairwiseRangemaps(rangemaps, projection, diag = TRUE, unions = TRUE,
verbosity = 2, Ncpu = 1, nchunks = 1, subchunks = NULL,
filename = "rangemap_matrix.csv")
``` |

`rangemaps` |
a character vector of rangemap filenames, including folder paths if not in the woorking directory. ESRI shapefile (.shp) is currently the only accepted format. Specifying the extension is optional. |

`projection` |
argument to be passed to function |

`diag` |
logical, whether to fill the diagonal of the resulting matrix with the area of each rangemap. The default is TRUE, and it is also automatically set to TRUE (as it is necessary) if |

`unions` |
logical, whether to fill the upper triangle of the resulting matrix with the area of union of each pair of rangemaps. The default is TRUE. It is not as computationally intensive as the intersection, as it is calculated not with spatial but with algebraic operations within the matrix (union = area1 + area2 - intersection). |

`verbosity` |
integer number indicating the amount of messages to display. |

`Ncpu` |
integer indicating the number of CPUs (central processing units) to employ if parallel computing is to be used. The default is 1 CPU, which implies no parallel computing, but you might want to increase this if you have many and/or large rangemaps and your machine has more cores that can be used simultaneously. You can find out the total number of cores in you machine with the |

`nchunks` |
either an integer indicating the number of chunks of rows in which to divide the results matrix for calculations, or character value "decreasing" indicating that the matrix should be divided into chunks of decreasing number of rows (as intersections are calculated in the lower triangle, rows further down the matrix have an increasing number of intersections to compute; note, however, that rangemap size, not rangemap number, is the main determinant of computation time). The default is 1 (no division of the matrix) but, if you have many rangemaps, the memory can get clogged. With chunks, each set of rows of the matrix is calculated and saved to disk, and the memory is cleaned before the next chunk begins. |

`subchunks` |
optional integer vector specifying which chunks to actually calculate. This is useful if a previous, time-consuming run of pairwiseRangemaps was interrupted (e.g. by a power outage) and you want to calculate only the remaining chunks. |

`filename` |
optional character vector indicating the name of the file to save the resulting matrix to. |

This calculation can be very intensive and slow, especially if you have many and/or large rangemaps, due to the time needed for spatial operations between maps. You can set nchunks = "decreasing" for the matrix to be calculated in parts and the memory cleaned between one part and the next; and, if your computer has more than one core that you can use, you can increase `Ncpu`

to get parallel computing.

This function returns a square matrix containing, in the lower triangle, the area of the pair-wise intersections among the input `rangemaps`

; in the diagonal (if `diag = TRUE`

or `union = TRUE`

), the area of each rangemap; and in the upper triangle (if `union = TRUE`

), the area of the pair-wise unions among the rangemaps.

This function uses the PBSmapping package to import and intersect the polygon rangemaps and to calculate areas. Remember to use projected rangemaps, preferably with an equal-area reference system, so that calculations are correct.

A. Marcia Barbosa

Barbosa A.M. & Estrada A. (in press) Calcular corotipos sin dividir el territorio en OGUs: una adaptacion de los indices de similitud para su utilizacion directa sobre areas de distribucion. In: Areas de distribucion: entre puentes y barreras. Universidad de Granada, Spain.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.