remove_dyads {EloSteepness} | R Documentation |
remove interactions from matrix to increase sparseness
Description
remove interactions from matrix to increase sparseness
Usage
remove_dyads(
m,
removal_mode = c("mix", "by_interaction", "by_dyad"),
stop_at = 0.5,
max_out = NULL
)
Arguments
m |
input matrix |
removal_mode |
character, should interactions be removed interaction by
interaction ( |
stop_at |
numeric, fraction of unknown relationships to be reached |
max_out |
numeric, the number of matrices to be returned maximally.
This is useful if the input matrix is fairly large. If set, this
will return the input matrix plus |
Value
a list with two items. $summary
is a data frame with an
overview. matrices
contains the actual interaction
matrices with increasing proportion of unknown relationships.
Examples
data(bonobos)
res <- remove_dyads(bonobos)
res$summary
length(res$matrices)
lapply(res$matrices, prunk)
res <- remove_dyads(bonobos, max_out = 2)
# first plus two randomly selected = 3 matrices
length(res$matrices)
res$summary