assoc_mat: Create an host-symbiont association matrix

View source: R/assoc_mat.R

assoc_matR 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))



Rtapas documentation built on June 22, 2024, 10:47 a.m.