web_matrix_to_df: Transform web matrix to expanded data frame

View source: R/helpers.r

web_matrix_to_dfR Documentation

Transform web matrix to expanded data frame

Description

Transform a web matrix to an expanded data frame which is needed as input for the bootstrap functions. Each row (interaction) is repeated as many times as it was observed. This is important for the sampling procedure. Rows are shuffled.

Usage

web_matrix_to_df(web, seed = 42)

Arguments

web

A web matrix, e.g. Safariland from bipartite.

seed

Passed to set.seed(). Used for shuffling rows in a reproducible way.

Value

Returns an expanded data frame needed as input for the bootstrap functions. Rows are shuffled.

Examples


library(bootstrapnet)
library(bipartite)
data(Safariland)

Safariland_df <- web_matrix_to_df(Safariland)


valentinitnelav/bootstrapnet documentation built on June 5, 2024, 3:21 p.m.