reshape_net: Transform network (web) matrix to data table

View source: R/helpers.r

reshape_netR Documentation

Transform network (web) matrix to data table

Description

Helper function to transform a network matrix (web) to a data frame, where each row represents an interaction between a low level and high level species (e.g. plant - pollinator).

Usage

reshape_net(net, abund = TRUE, seed)

Arguments

net

A network matrix (a web), e.g. Safariland from bipartite.

abund

Logic type (TRUE or FALSE). Default is TRUE, that is abundance information is considered and an interaction is repeated as many times it was observed. If FALSE then it returns only the unique interactions.

seed

A single integer value. Passed to set.seed. Set seed to get reproducible random results.

Value

Returns a data frame.

Examples


library(bootdissim)
library(bipartite)

# Considering abundance information
Safariland_dt <- reshape_net(Safariland, abund = TRUE, seed = 1)

# Without abundance information
Safariland_dt <- reshape_net(Safariland, abund = FALSE, seed = 1)


valentinitnelav/bootdissim documentation built on Oct. 11, 2022, 12:34 a.m.