mxcount {mefa} | R Documentation |
The function merges two objects of class 'xcount'. Rows with zero total counts 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, see example).
When segment values of xc1 and xc2 are the same, segment argument specified here
has no effect and the original is retained. When segment values of xc1 and xc2 are different,
it is set to "unspecified" as default. |
A result is an object of class 'xcount'.
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)