View source: R/marxan_boundary_data_to_matrix.R
marxan_boundary_data_to_matrix | R Documentation |
Convert a data.frame
object containing Marxan boundary data
to matrix format. This function is designed specifically for
boundary data (not connectivity data).
It ensures that the output matrix correctly specifies
symmetric spatial relationships between planning units.
marxan_boundary_data_to_matrix(x, data)
x |
|
data |
|
A Matrix::dgCMatrix
sparse matrix object.
In earlier versions, the function could convert boundary data that pertain to multiple zones. This is no longer possible, following updates to streamline the package.
# create marxan boundary with four planning units and one zone
bldf1 <- expand.grid(id1 = seq_len(4), id2 = seq_len(4))
bldf1$boundary <- 1
bldf1$boundary[bldf1$id1 == bldf1$id2] <- 0.5
# convert to matrix
m1 <- marxan_boundary_data_to_matrix(NULL, bldf1)
# visualize matrix
## Not run:
Matrix::image(m1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.