read.CEP {rioja} | R Documentation |
Reads and writes data in Cornell Ecology Program (CEP) format used by CANOCO and other programs.
read.CEP(fName, mValue=-99.9, impZero=0) write.CEP(x, fName, fTitle=fName, type = "condensed", nSig=5, nCouplets=4, mValue=-99.9)
fName |
filename to read. |
mValue |
missing value code in the CEP file, converted to NA on import. |
impZero |
value to assign to "missing" taxa in a condensed CEP file. These are usually implicitly zero and the default is to read them as such. |
x |
data frame to save in CEP format. |
fTitle |
title for header in CEP file. |
type |
format of CEP file. Should be an unambiguous abbreviation of either condensed or full . condensed is usually used for species data and full for environmental data |
nSig |
number of significant digits to include in output. |
nCouplets |
number of couplets per line to include in condensed file. |
read.CEP
and write.CEP
are functions to read and write data in the Cornell Ecology Program (CEP) format. CEP condensed format was originally designed by Mark Hill as an efficient way of storing species abundance data for use with his DECORANA and TWINSPAN programs (Hill 1979a, b), and subsequently adopted by CANOCO (ter Braak & Smilauer, 1998) where full and free format variations were added. read.CEP
and write.CEP
can read/write data in condensed and full formats. The CEP in read.CEP
is capitalised to distinguish it from a similar function (read.cep)
in the vegan
package, which can also import data in CEP free
write.CEP
takes the site and species names from the rownames
and colnames
of the input data frame. Names in CEP format are limited to a maximum of 8 characters - if they excede this limit they will be abbreviated using the function make.cepnames
in the package vegan
and a warning issued. The function invisibly returns a list of original and saved names.
read.CEP
returns a data frame with species as columns and sites as rows. Columns with zero totals (ie. species with no occurrences) are deleted. Column and row names are taken from the species and site names in the CEP file: invalid characters in the names (including spaces) are replaced by "." and names are made unique using make.names
.
write.CEP
returns a list with two named elements, site.names
and sp.names
, each character matrix of two columns giving the original and saved site or species names.
The code uses a combination of C and C++, with several function converted to C from FORTRAN using f2c. It works on 32 bit systems but currently generates an error on some 64-bit systems. Use read.cep
in the package vegan
as an alternative.
Steve Juggins
Hill, M.O. (1979a). DECORANA - A FORTRAN program for detrended correspondence analysis and reciprocal averaging. Cornell University, Ithaca, New York. Program manual..
Hill, M.O. (1979b). TWINSPAN - A FORTRAN program for arranging multivariate data in an ordered two-way table by classification of the individuals and attributes. Cornell University, Ithaca, New York. Program manual. 90pp.
ter Braak, C.J.F. & Smilauer, P. (1998) CANOCO Reference Manual and User's Guide to CANOCO for Windows: Software for Canonical Community Ordination (version 4) Microcomputer Power, Ithaca, NY, USA.
## Not run: pth <- system.file("example.datasets/RLGHLongCore.cep", package="rioja") rlgh <- read.CEP(pth) depth <- as.numeric(gsub("r_", "", rownames(rlgh))) mx <- apply(rlgh, 2, max) rlgh.sub <- rlgh[, mx > 5] strat.plot(rlgh.sub, scale.percent=TRUE, yvar=depth, y.rev=TRUE, wa.order="bottomleft") ## End(Not run)