xcount {mefa} | R Documentation |
The function makes an object of class 'xcount' from an object of class 'sscount'.
xcount(ssc, segment = 0, segment.name = NULL) ## S3 method for class 'xcount': print(x, cutoff = 25, ...) ## S3 method for class 'xcount': plot(x, type = "hist", rug = FALSE, logscale = FALSE, ...)
ssc |
an object of class 'sscount'. |
segment |
identifier of the segment within the 'sscount' object
to make the crosstabulation, the default 0 refers to "all" segments.
It can have more than one element (but lessthan or equal to the number of elements in the segment list).
When it is a vector, corresponding levels are combined and named as specified by segment.name . |
segment.name |
character, it has effect only when segment is vector. If not specified, segment value
in the result is set to "mixed" (if all segments are listed, it is set to "all" ). |
x |
an object of class 'xcount'. |
type |
character, can be "hist" for histogram, "rank" for rank abundance/occurence curves and
"biplot" for plot abundance vs. occurence data. |
rug |
logical, if TRUE , add rug to the plot (default is FALSE ). It has effect only if
type="hist" . |
logscale |
logical, if TRUE , plotted values are $log10(y+1)$ transformed.
Default FALSE leaves the values intact. |
cutoff |
number of samples/species with zero toal count to be listed. |
... |
other arguments. |
If data in the 'sscount' object are of measurement type, digits
value is inherited from the 'sscount' object
and used in crosstabulation. For large (>2) digit
values, computing time may take several seconds. Current implementation of handling measurement type data is based on the inflate
function, which is not fully vectorized.
The print
method produces 4 graphs in one window, displaying histograms type="hist"
or rank abundance curves type="rank"
of the vectors ninds
, srichn
,
specabund
and specoccur
. If the data are of presence/absence and not abundance type, only srichn
and specoccur
are displayed. These values are based on the function marmat
. The option type="biplot"
deisplays 2 graphs, one for samples and one for species, combining presence/absence and abundance data in the same plot.
A result is an object of class 'xcount'.
data |
matrix containing count data of sample/species crosstabulation. Crosstabulation results the same dimensions for data matrices of each segments. |
call |
returns the call. |
segment |
segment of the 'sscount' object of which the crosstabulation was made, or "all" . |
digits |
inherited from the 'sscount' object. |
nsamples |
number of rows (samples) in data . |
nspecies |
number of columns (species) in data . |
totalcount |
sum of count or measurement in data . |
presences |
sum of presences in data . |
ninds |
a vector, containing number of individuals (or sum of measurement values) within samples. |
srichn |
a vector, containing number of species (based on occurences) within samples. |
specabund |
a vector, containing number of individuals (or sum of measurement values) within species. |
specoccur |
a vector, containing number of occurences within species. |
Peter Solymos, Solymos.Peter@aotk.szie.hu, http://www.univet.hu/users/psolymos/personal/
as.xcount
, check.attrib
, marmat
, mefa
,
sscount
, xorder
### 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") xc1 <- xcount(sscount(ss, zc="zero")) xc1 xc2 <- xcount(sscount(ss, zc="zero.count")) xc2 xc3 <- xcount(sscount(ss, zc="zero.count"), 0) xc3 xc4 <- xcount(sscount(ss, zc="zero.count"), 1) xc4 ### Example 2: field data of the dolina ## Not run: data(dol.count, dol.sample, landsnail) dssc <- sscount(dol.count, zc="zero.count", fill=TRUE) dssc (xc <- xcount(dssc)) plot(xc, type="hist") plot(xc, type="rank", logscale = TRUE) plot(xc, type="biplot") xcount(dssc, "broken") xcount(dssc, c("adult", "juvenile")) xcount(dssc, c(1,4), "mixed") xcount(dssc, c(1:3)) ## End(Not run)