mxcount                 package:mefa                 R Documentation

_M_e_r_g_e_s _T_w_o _O_b_j_e_c_t_s _o_f _C_l_a_s_s '_x_c_o_u_n_t'

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

     The function merges two objects of class 'xcount'. Rows with zero
     total count are handled internally by functions 'msscount' and
     'ttsscount'.

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

     mxcount(xc1, xc2, segment = "unspecified")

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

     xc1: an object of class 'xcount'.

     xc2: an object of class 'xcount'.

 segment: arbitrary name of the segment (eg. all or mixed, when
          'segment' values of 'xc1'  and 'xc2' are different) included
          in the table,  by default it is '"unspecified"'.

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

     A result is an object of class 'xcount'. 

 segment: value of the 'segment' argument.

    data: matrix containing merged count data of sample/species
          crosstabulation.

nsamples: number of rows (samples) in 'data'.

nspecies: number of columns (species) in 'data'.

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

     Peter Solymos, Solymos.Peter@aotk.szie.hu, <URL:
     http://www.univet.hu/users/psolymos/personal/>

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

     'xcount'

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

     ss1 <- data.frame(
     cbind(
     c("sample1","sample1","sample2","sample2","sample3","sample4"),
     c("species1","species1","species1","species2","species3","zero.count"),
     c("male","female","male","female","male","male")
     ),
     c(1, 2, 10, 3, 4, 1)
     )
     colnames(ss1) <- c("sample.id", "species.id", "gender", "catch")

     ss2 <- data.frame(
     cbind(
     c("sample1","sample1","sample5","sample5"),
     c("species1","species4","species1","species5"),
     c("male","female","male","female")
     ),
     c(3, 2, 1, 4)
     )
     colnames(ss2) <- c("sample.id", "species.id", "gender", "catch")

     xc1 <- xcount(sscount(ss1, zc="zero.count"))
     xc2 <- xcount(sscount(ss1, zc="zero.count"), 1)
     xc3 <- xcount(sscount(ss2))

     mxcount(xc1, xc2, "mixed")
     mxcount(xc1, xc3)

