conformveg: Conform two community data tables

View source: R/conformveg.R

conformvegR Documentation

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)

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.

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.

Value

A list with the two inflated matrices x and y.

Author(s)

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

See Also

vegclust, vegclass

Examples

## 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)

emf-creaf/vegclust documentation built on July 27, 2024, 7:32 a.m.