disjoin: Complete disjoined coded data (binary coding)

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Transform a factor in separate variables (one per level) with a binary code (0 for absent, 1 for present) in each variable

Usage

1

Arguments

x

a vector containing a factor data

Details

Use cut() to transform a numerical variable into a factor variable

Value

a matrix containing the data with binary coding

Author(s)

Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)

References

Fromentin J.-M., F. Ibanez & P. Legendre, 1993. A phytosociological method for interpreting plankton data. Mar. Ecol. Prog. Ser., 93:285-306.

Gebski, V.J., 1985. Some properties of splicing when applied to non-linear smoothers. Comput. Stat. Data Anal., 3:151-157.

Grandjouan, G., 1982. Une méthode de comparaison statistique entre les répartitions des plantes et des climats. Thèse d'Etat, Université Louis Pasteur, Strasbourg.

Ibanez, F., 1976. Contribution à l'analyse mathématique des événements en Ecologie planctonique. Optimisations méthodologiques. Bull. Inst. Océanogr. Monaco, 72:1-96.

See Also

buysbal, cut

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Artificial data with 1/5 of zeros
Z <- c(abs(rnorm(8000)), rep(0, 2000))
# Let the program chose cuts
table(cut(Z, breaks=5))
# Create one class for zeros, and 4 classes for the other observations
Z2 <- Z[Z != 0]
cuts <- c(-1e-10, 1e-10, quantile(Z2, 1:5/5, na.rm=TRUE))
cuts
table(cut(Z, breaks=cuts))
# Binary coding of these data
disjoin(cut(Z, breaks=cuts))[1:10, ]

pastecs documentation built on May 2, 2019, 3:36 p.m.

Related to disjoin in pastecs...