Learn R Programming

vegclust (version 2.0.2)

conformveg: Conform two community data tables

Description

Conforms two community data tables to have the same set of columns (species)

Usage

conformveg(x, y, fillvalue = 0, verbose=FALSE)

Value

A list with the two inflated matrices x and y.

Arguments

x

Community data, a site-by-species matrix.

y

Community data, a site-by-species matrix.

fillvalue

The value to be used to fill new entries in inflated matrices.

verbose

Displays information about the number of species shared between x and y, as well as the number of species that are in one of the data tables but not in the other.

Author

Miquel De Cáceres, Centre Tecnologic Forestal de Catalunya.

Details

This function adds to x as many new columns as columns of y that are not in x. The same is done for y, so the two tables have the same set of columns when they are returned.

See Also

vegclust, vegclass

Examples

Run this code
## Loads data (38 columns and 33 species)
data(wetland)
dim(wetland)

## Splits wetland data into two matrices of 30x27 and 11x22
wetland.30 = wetland[1:30,]
wetland.30 = wetland.30[,colSums(wetland.30)>0]
dim(wetland.30)
wetland.11 = wetland[31:41,]
wetland.11 = wetland.11[,colSums(wetland.11)>0] 
dim(wetland.11)

## Conforms the two matrices so they can eventually be merged
wetland.cf = conformveg(wetland.30, wetland.11)
dim(wetland.cf$x)
dim(wetland.cf$y)
names(wetland.cf$x)==names(wetland.cf$y)

Run the code above in your browser using DataLab