alienData: Formatting data and return an 'alienData' object

Description Usage Arguments Details Value Author(s)

View source: R/alienData.R

Description

alienData is used to check and format data, if correct it returns an object of class alienData.

Usage

1
2
3
4
5
6
7
8
alienData(
  node,
  edge,
  trait = NULL,
  phylo = NULL,
  directed = TRUE,
  verbose = TRUE
)

Arguments

node

A data.frame with two columns. The first column includes unique individual identifications and needs to be defined as "idInd" while the second columns presents species identification and needs to be defined as "idSp". (See details).

edge

A data frame with two columns: from and to describing the set of edges (links between nodes). If directed is set to TRUE then the interaction is directed from a resource to a consumer. The presence of a value and site which respectively provide the values associated with edges (if absent, they are set to 1) and the identifier of the site where the interaction has been observed. (See details).

trait

A data.frame with three columns. The first column is the individual identifier and needs to be defined as "idInd", the second column is the trait names and needs to be defined as "trait" while the third column is the trait characteristic, which could be a numeric or a character string and needs to be called "value". (See details).

phylo

An object (or a list of objects) of class phylo .

directed

Logical. If TRUE (default value) the network is considered directed. (See details).

verbose

Logical. Should extra information be reported on progress?

Details

In the nodes argument, the first columns (individual identification) should have unique (non-repetitive) identifiers for each lines while the species identifier (usually a species code or a the species name) can be repeted.

If the data available is at the species level, the species as well as the individual identifiers will not independently repeat. In this case, the individual identifier idInd will be replaced by the species identifier idSp in node, thus allowing edges and trait to present relations using species identifier. An error will be sent if multiple individuals were measured for each species.

It is from the trait argument that an individual (or a species) by trait matrix is constructed using the getTrait() function. Because, many of the models considered in this package do not handle NAs, it becomes important to make sure all combinations of individuals (or species) by traits are defined in the trait matrix resulting from the getTrait() function.

The check on the phylo argument assumes that the phylogeny is at the species level.

Value

An object of class alienData is returned.

Because an alienData object is organized for data processing rather than for presentation. When printed on screen, only a summary of the data is presented.

Author(s)

F. Guillaume Blanchet, Kevin Cazelles & Steve Vissault


TheoreticalEcosystemEcology/alien documentation built on Feb. 21, 2020, 7:12 p.m.