read.cep: Reads a CEP (Canoco) data file

Description Usage Arguments Details Value Note Author(s) References Examples

Description

read.cep reads a file formatted by relaxed strict CEP format used by Canoco software, among others.

Usage

1
read.cep(file, maxdata=10000, positive=TRUE, trace=FALSE, force=FALSE)

Arguments

file

File name (character variable).

maxdata

Maximum number of non-zero entries.

positive

Only positive entries, like in community data.

trace

Work verbosely.

force

Run function, even if R refuses first.

Details

Cornell Ecology Programs (CEP) introduced several data formats designed for punched cards. One of these was the ‘condensed strict’ format which was adopted by popular software DECORANA and TWINSPAN. Later, Cajo ter Braak wrote Canoco based on DECORANA, where he adopted the format, but relaxed it somewhat (that's why I call it a ‘relaxed strict’ format). Further, he introduced a more ordinary ‘free’ format, and allowed the use of classical Fortran style ‘open’ format with fixed field widths. This function should be able to deal with all these Canoco formats, whereas it cannot read many of the traditional CEP alternatives.

All variants of CEP formats have:

With option positive = TRUE the function removes all lines and columns with zero or negative marginal sums. In community data with only positive entries, this removes empty sites and species. If data entries can be negative, this ruins data, and such data sets should be read in with option positive = FALSE.

Value

Returns a data frame, where columns are species and rows are sites. Column and row names are taken from the CEP file, and changed into unique R names by make.names after stripping the blanks.

Note

The function relies on smooth linking of Fortran file IO in R session. This is not guaranteed to work, and therefore the function may not work in your system, but it can crash the R session. Therefore the default is that the function does not run. If you still want to try:

  1. Save your session

  2. Run read.cep() with switch force=TRUE

If you transfer files between operating systems or platforms, you should always check that your file is formatted to your current platform. For instance, if you transfer files from Windows to Linux, you should change the files to unix format, or your session may crash when Fortran program tries to read the invisible characters that Windows uses at the end of each line.

If you compiled vegan using gfortran, the input is probably corrupted. You either should compile vegan with other FORTRAN compilers or not to use read.cep. The problems still persist in gfortran 4.01.

Author(s)

Jari Oksanen

References

Ter Braak, C.J.F. (1984–): CANOCO – a FORTRAN program for canonical community ordination by [partial] [detrended] [canonical] correspondence analysis, principal components analysis and redundancy analysis. TNO Inst. of Applied Computer Sci., Stat. Dept. Wageningen, The Netherlands.

Examples

1
2
3
4
## Provided that you have the file `dune.spe'
## Not run: 
theclassic <- read.cep("dune.spe", force=T)
## End(Not run)

pattakosn/Rworkshop documentation built on May 24, 2019, 8:22 p.m.