Learn R Programming

ATNr (version 1.1.0)

sort_input: Sort custom input

Description

Sort custom input

Usage

sort_input(BM, fw)

Value

A list with sorted body masses (body.mass) and food web matrix (food.web).

Arguments

BM

numeric vector, body mass of species.

fw

adjacency matrix of the food web.

Details

Body masses and food web matrix should be arranged with the first elements/columns being for basal species. This is a requirement for the Cpp class and must be enforced before initializing the Rcpp_Schneider and Rcpp_Delmas objects.

Examples

Run this code
bm <- runif(10, 10, 50)
fw <- matrix(as.numeric(runif(100) > .9), 10, 10)
sort_input(bm, fw)

Run the code above in your browser using DataLab