Learn R Programming

Traitspace (version 1.1)

check: Checks the input data

Description

Performs basic checks on the data and arranges it in a format that can be used as an input into the remaining functions of this package.

Usage

check(level_1, level_2, level_3, site, N)

Arguments

level_1
A column containing the names of the tree species
level_2
Column/s containing the trait values
level_3
Column/s containing enviromental gradient/s
site
A column containing the site names.
N
Size of the simulated trait sample.

Value

A list of transformed data that can be used as an input in the remaining functions of this package.

Details

Transforms the existing data into appropriate format. This includes: 1) transform level_1 into factors; 2) transform level_2 and level_3 into dataframes; 3) generate a new factor site.name and a new dataframe site by the input site; 4) check the dimentions of these data and 5) make sure level_2 does not has negative value.

Examples

Run this code
data(spdata)
species<-spdata$species  #species column
trt<-cbind(spdata$t1,spdata$t2) #two traits
env<-spdata$env     #one env gradient
site<-spdata$site   #site information

check(species, trt, env, site)

Run the code above in your browser using DataLab