assoc_mat {Rtapas} | R Documentation |
Create an host-symbiont association matrix
Description
Creates a binary host-symbiont association matrix from a two-columns matrix or data frame of host-symbiont associations.
Usage
assoc_mat(hs)
Arguments
hs |
A two-columns matrix or data frame representing associations between hosts (column 1) and symbionts (column 2) species. |
Value
An association binary matrix, with hosts in rows and symbionts in columns, sorted alphabetically.
Examples
data(nuc_cp)
NTaxa <- sort(NUCtr$tip.label)
CPTaxa <- sort(CPtr$tip.label)
NC <- assoc_mat(data.frame(NTaxa, CPTaxa))
[Package Rtapas version 1.2 Index]