Matrix2DF: Convert a bipartite-style matrix to dataframe

Description Usage Arguments Details Value Examples

View source: R/Matrix2DF.R

Description

Matrix2DF returns a data frame in the format internally required for bipartiteD3 where the first two columns list the interacting species, and the third column lists the link strengths.

Usage

1
2
Matrix2DF(Matrix, PrimaryLab = "Primary", SecondaryLab = "Secondary",
  SiteLab = "Site")

Arguments

Matrix

Bipartite network in matrix format

PrimaryLab

Label for the primary level of the bipartite web, e.g. 'Plants'

SecondaryLab

Label for the secondary level of the bipartite web, e.g. 'Pollinators'

SiteLab

Name for the site

Details

Matrix2DF expects a matrix of the format used by bipartite, for example that created by frame2webs(). This structure includes row and column names to indicate the species, and a named third dimension giving the name of that site.

Note a matrix of this format can be passed directly to bipartite_D3() since it will test for a matrix and apply Matrix2DF() anyway.

Value

A data.frame where the first column is the primary interactor, the second the secondary interactor and third column detail the link strengths.

Examples

1
2
data(Safariland, package='bipartite')
Matrix2DF(Safariland)

bipartiteD3 documentation built on Nov. 27, 2018, 1:05 a.m.