disjoin               package:pastecs               R Documentation

_C_o_m_p_l_e_t_e _d_i_s_j_o_i_n_e_d _c_o_d_e_d _d_a_t_a (_b_i_n_a_r_y _c_o_d_i_n_g)

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     disjoin(x)

_A_r_g_u_m_e_n_t_s:

       x: a vector containing a factor data 

_D_e_t_a_i_l_s:

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

_V_a_l_u_e:

     a matrix containing the data with binary coding

_A_u_t_h_o_r(_s):

     Frdric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean
     (phgrosjean@sciviews.org)

_R_e_f_e_r_e_n_c_e_s:

     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 mthode de comparaison statistique entre
     les rpartitions des plantes et des climats. Thse d'Etat,
     Universit Louis Pasteur, Strasbourg.

     Ibanez, F., 1976. Contribution  l'analyse mathmatique des
     vnements en Ecologie planctonique. Optimisations
     mthodologiques. Bull. Inst. Ocanogr. Monaco, 72:1-96.

_S_e_e _A_l_s_o:

     `buysbal', `cut'

_E_x_a_m_p_l_e_s:

     # 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, ]

