mefa                  package:mefa                  R Documentation

_M_a_k_e_s _O_b_j_e_c_t _o_f _C_l_a_s_s '_m_e_f_a'

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

     Makes and object of class 'mefa' from az 'xcont' and sample and
     species attribute 'xorder' objects.

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

     mefa(xc, xorder.samples, xorder.species)

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

      xc: object of class 'xcount'.

xorder.samples: object of class 'xorder' for sample attributes.

xorder.species: object of class 'xorder' for species attributes.

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

     A result is an object of class 'mefa'. 

 segment: segment of the 'xcount' object.

  xcount: count data from the 'xcount' object

sample.attr: data frame containing data of 'xorder' object containing
          sample attributes.

species.attr: data frame containing data of 'xorder' object containing
          species attributes.

nsamples: number of samples.

nspecies: number of species.

totalcount: total number of counts in 'xcount'.

nsample.attr: number of sample attribute columns in 'sample.attr'.

nspecies.attr: number of species attribute columns in 'species.attr'.

_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:

     'check.attrib', 'sscount', 'xcount', 'xorder'

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

     ### Example 1: simple atrificial data

     ss <- 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(ss) <- c("sample.id", "species.id", "gender", "catch")

     spectab <- as.data.frame(rbind(
             c("species3", "family1", "1"),
             c("species2", "family2", "5"),
             c("species1", "family1", "2"),
             c("species5", "family2", "1"),
             c("species4", "family1", "10")
     ))
     colnames(spectab) <- c("species", "taxonomy", "size")

     sampletab <- as.data.frame(rbind(
             c("sample3", "bad"),
             c("sample1", "good"),
             c("sample2", "good"),
             c("sample4", "bad")))
     colnames(sampletab) <- c("sample", "quality")

     xct <- xcount(sscount(ss, zc="zero.count"))
     xo1 <- xorder(xct, "samples", sampletab, 1)
     xo2 <- xorder(xct, "species", spectab, 1)

     mf1 <- mefa (xct, xo1, xo2)
     mf1

     mf2 <- mefa(xcount(sscount(ss, zc="zero.count"), 2), xo1, xo2)
     mf2

     ### Example 2: field data of Villany Hills

     ## Not run: 
     data(landsnail, vsample, vtable)

     vt <- as.xcount(vtable, FALSE)
     spec <- xorder(vt, which="species", landsnail, 2)
     sampl <- xorder(vt, which="samples", vsample)

     vmf <- mefa(vt, sampl, spec)
     vmf

     ### Example 3: field data of the dolina

     data(dol.count, dol.sample, landsnail)

     dmf <- mefa(
     dxc <- xcount(sscount(fill.count(dol.count), zc="zero.count")),
     xorder(dxc, which="samples", dol.sample),
     xorder(dxc, which="species", landsnail, 2)
     )

     dmf
     ## End(Not run)

