Array2DF function

Convert bipartite-style arrays to dataframe

Convert bipartite-style arrays to dataframe

Returns a data frame in the format internally required for bipartiteD3 where the first two columns list the interacting species, and subsequent columns list the link strengths in each site.

Array2DF( Array, PrimaryLab = "Primary", SecondaryLab = "Secondary", SiteNames = NULL )

Arguments

  • Array: An array of bipartite 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'
  • SiteNames: Vector of names for the different sires (array slices). By default takes names of input array if they exist.

Returns

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

Details

Array2DF expects an array of multiple bipartite webs as may be created by the webs2array() function in bipartite. This structure includes row and column names to indicate the species, and a named third dimension giving the names of each of the sites

Note an array of this format can be passed directly to bipartite_D3 since it will test for an array and apply Array2DF() anyway.

Examples

## Not run: data(Safariland, vazquenc, package='bipartite') allin1 <- bipartite::webs2array(Safariland, vazquenc) Array2DF(allin1) ## End(Not run)
  • Maintainer: Chris Terry
  • License: GPL-3
  • Last published: 2024-09-02

Useful links