organize.syncsa: Function for organize data for Package SYNCSA

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Package SYNCSA requires that the species and community sequence in the data.frame or matrix must be the same for all data.frame/matrices.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
organize.syncsa(
  comm,
  traits = NULL,
  phylodist = NULL,
  envir = NULL,
  strata = NULL,
  check.comm = TRUE,
  convert.traits = FALSE,
  ranks = TRUE
)

Arguments

comm

Community data, with species as columns and sampling units as rows.

traits

Matrix or data.frame of species described by traits, with traits as columns and species as rows (Default traits = NULL).

phylodist

Matrix containing phylogenetic distance between species. Must be a complete matrix (not a half diagonal matrix).This matrix can be larger than community data (more species) as long as it has at least all species that are in community data (Default phylodist = NULL).

envir

Environmental variables for each community, with variables as columns and sampling units as rows (Default envir = NULL).

strata

Strata named vector to specify restricting permutations within species groups (Default strata = NULL).

check.comm

Logical argument (TRUE or FALSE) to remove sampling units and species with total sums equal or less than zero (Default check.comm = TRUE).

convert.traits

Logical argument (TRUE or FALSE) to convert factor traits in dummy traits and/or convert ordinal variables in numeric (see ranks argument) (Default convert.traits = FALSE).

ranks

Logical argument (TRUE or FALSE) to specify if ordinal variables are convert to ranks. If ranks = TRUE all ordered variable are replaced by their ranks and if ranks = FALSE all ordinal variables are simply treated as continuous variables (Default ranks = TRUE).

Details

The function organizes the data for the functions of the package SYNCSA, placing the matrices of community, traits, phylogenetic distance, environmental varibles and strata vector in the same order. The function use as reference the community data for organize all data.frame or matrices in the same order that the sampling units names and species names found in community data set. For this all data sets entered must be correctly named, with rows and columns named. The matrices phylodist, traits, envir can be larger than community data (more species and/or more sampling units) as long as it has at least all species and/or sampling units that are in community data. The function organizes the data despite the absence of one of the data.frames or matrices, provided that the community data had been entered. Unspecified data will appear as NULL.

When trait is a data.frame with differents types of variables correctly identified and the argument convert.traits is TRUE factor traits are expanded in dummy traits and ordinal variables are converted in numeric according to ranks argument.

The strata must be a named vector. The strata vector is a vector for restrict permutation within species groups, insofar as the SYNCSA package the null models are based in permutation of species rather than permutation of sample units.

Value

A object of class metacommunity.data (also of the class list) with the data.frames or matrices:

call

The arguments used.

community

Community data.

traits

Traits data.

phylodist

Phylogenetic distance.

environmental

Environmental variables.

community.var.type

Type of each varible in community data, where 'c' to continuous/numeric, 'o' to ordinal, 'b' to binary and 'f' to factor. Nominal are not allowed.

traits.var.type

Type of each varible in traits data. See labels above.

phylodist.var.type

Type of each varible in phylodist. See labels above.

environmental.var.type

Type of each varible in environmental data. See labels above.

strata

The strata vector for permutations.

put.together

A list with suggestion to group of traits that are analyzed together, only if convert.traits is TRUE and if some traits are of factor class.

list.warning

A list of warning.

Author(s)

Vanderlei Julio Debastiani <vanderleidebastiani@yahoo.com.br>

See Also

syncsa, var.dummy, var.type

Examples

1
2
data(ADRS)
organize.syncsa(ADRS$community, ADRS$traits, ADRS$phylo, ADRS$envir)

Example output

$call
organize.syncsa(comm = ADRS$community, traits = ADRS$traits, 
    phylodist = ADRS$phylo, envir = ADRS$envir)

$community
        Sp_1 Sp_2 Sp_3 Sp_4 Sp_5 Sp_6
Site_1     1    2    0    0    0    0
Site_2     0    0    0    0    1    2
Site_3     0    1    0    0    6    0
Site_4    11    4    0    0    8    1
Site_5    11    5   17    7    0    0
Site_6     9    6    0    0    6    2
Site_7     9    7   13   10    0    0
Site_8     7    8    0    0    4    3
Site_9     7    9   10   13    0    0
Site_10    5   10    0    0    2    4

$traits
      Trait_1   Trait_2
Sp_1 1.101801 1.0382325
Sp_2 1.133903 1.0636767
Sp_3 1.154003 1.0354208
Sp_4 1.124771 0.9197078
Sp_5 1.034940 0.9804634
Sp_6 1.016964 0.7875229

$phylodist
          Sp_1      Sp_2      Sp_3      Sp_4      Sp_5     Sp_6
Sp_1 0.0000000 0.1419384 0.2274796 1.6451914 1.6451914 1.645191
Sp_2 0.1419384 0.0000000 0.2274796 1.6451914 1.6451914 1.645191
Sp_3 0.2274796 0.2274796 0.0000000 1.6451914 1.6451914 1.645191
Sp_4 1.6451914 1.6451914 1.6451914 0.0000000 0.5924847 1.019961
Sp_5 1.6451914 1.6451914 1.6451914 0.5924847 0.0000000 1.019961
Sp_6 1.6451914 1.6451914 1.6451914 1.0199607 1.0199607 0.000000

$environmental
        Env_1
Site_1      1
Site_2      2
Site_3      3
Site_4      4
Site_5      5
Site_6      6
Site_7      7
Site_8      8
Site_9      9
Site_10     1

$community.var.type
[1] "c" "c" "c" "c" "c" "c"

$traits.var.type
[1] "c" "c"

$phylodist.var.type
[1] "c" "c" "c" "c" "c" "c"

$environmental.var.type
[1] "c"

SYNCSA documentation built on Jan. 11, 2020, 9:26 a.m.