Assign NA to missing data in the matrices
Usage
structural_na(A, label = NULL, bipartite = FALSE, column = FALSE)
Arguments
- A
A symmetric or incidence matrix object
- label
String vector with the names of the theoretical complete matrix
- bipartite
Whether the matrix is bipartite or not.
- column
Whether the assignation of NA is for columns in the biparite network, row by default.
Value
This function returns NA to missing data.
Author
Alejandro Espinosa-Rada
Examples
A <- matrix(c(
0, 1, 1,
1, 0, 1,
0, 0, 0
), byrow = TRUE, ncol = 3)
colnames(A) <- c("A", "C", "D")
rownames(A) <- c("A", "C", "D")
label <- c("A", "B", "C", "D", "E")
structural_na(A, label)
#> A B C D E
#> A 0 NA 1 1 NA
#> B NA NA NA NA NA
#> C 1 NA 0 1 NA
#> D 0 NA 0 0 NA
#> E NA NA NA NA NA