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

crosstabanalysis

Presence-absence Analysis by Cross Tabulation


Description

This function makes a cross-tabulation of two variables after transforming the first variable to presence-absence and then returns results of chisq.test.

Usage

crosstabanalysis(x,variable,factor)

Arguments

x

Data set that contains the variables "variable" and "factor".

variable

Variable to be transformed in presence-absence in the resulting cross-tabulation.

factor

Variable to be used for the cross-tabulation together with the transformed variable.

Value

The function returns the results of chisq.test on a crosstabulation of two variables, after transforming the first variable to presence-absence first.

Author(s)

Roeland Kindt

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

Examples

library(vegan)
data(dune.env)
crosstabanalysis(dune.env,"Manure","Management")

BiodiversityR

Package for Community Ecology and Suitability Analysis

v2.13-1
GPL-3
Authors
Roeland Kindt [cre, aut] (<https://orcid.org/0000-0002-7672-0712>)
Initial release
2021-4-15

We don't support your browser anymore

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