Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reconcile

Reconcile Community and Site Data.Frames


Description

reconcile takes two data frames (comm and site) and sorts both into the same order, and then deletes any rows unique to either of the two data.frames, achieving perfect correspondence of the two.

Usage

reconcile(comm,site,exlist)

Arguments

comm

a community abundance data.frame with samples as rows and species as columns

site

a data.frame of site or environmental variables with samples as rows and variables as columns

exlist

a switch to control listing specific plots vs simply the number of plots

Details

reconcile sorts each data.frame alphabetically by row.name, and then compares the list of row.names to identify sample plots common to both data.frames. Sample plots which occur in only one of the data.frames are deleted.

Value

A list object with two elements: comm and site, which are the sorted and reconciled data.frames.

Note

Package labdsv (and many other packages in ecological data analysis) require two data.frames to structure the data. One contains the abundance of species within samples with samples as rows and species as columns. This data.frame I refer to as the sQuotecomm data.frame. The other data.frame contains all the environmental or site data collected at the same samples. This data.frame I refer to as the ‘site’ data.frame. Due to independent subsampling, sorting or editing of the data (often outside of R) the two data.frames often lose the necessary requirement of the identical number of rows, with the rows in exactly the same order. The reconcile() function is a simple remedy to correct this situation while maintaining the maximum amount of data.

Author(s)

Examples

data(bryceveg)   # returns a data.frame of taxon abundance
data(brycesite)  # returns a data.frame of site variables
test <- reconcile(bryceveg,brycesite)

labdsv

Ordination and Multivariate Analysis for Ecology

v2.0-1
GPL (>= 2)
Authors
David W. Roberts <droberts@montana.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.