Learn R Programming

Rtapas (version 1.2)

assoc_mat: 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)

Value

An association binary matrix, with hosts in rows and symbionts in columns, sorted alphabetically.

Arguments

hs

A two-columns matrix or data frame representing associations between hosts (column 1) and symbionts (column 2) species.

Examples

Run this code
# \donttest{
data(nuc_cp)
NTaxa <- sort(NUCtr$tip.label)
CPTaxa <- sort(CPtr$tip.label)

NC <- assoc_mat(data.frame(NTaxa, CPTaxa))
# }

Run the code above in your browser using DataLab