| mxcount {mefa} | R Documentation |
The function merges two objects of class 'xcount'. Rows with zero total count are handled internally by functions msscount and ttsscount.
mxcount(xc1, xc2, segment = "unspecified")
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". |
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. |
Peter Solymos, Solymos.Peter@aotk.szie.hu, http://www.univet.hu/users/psolymos/personal/
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)