sscount {mefa} | R Documentation |
The function makes an object of class 'sscount' from a data frame with columns for samples, species, count and optionally segment. Count column may contain count or measurement data, too. Data can be in 'notebook' style with empty cells.
sscount(sstable, zc = NULL, fill = FALSE, digits = NULL) ## S3 method for class 'sscount': print(x, ...)
sstable |
dataframe with three or four columns. Columns must be in the order of sample, species, segment (optional) and count. |
zc |
identifier for samples with zero count, by default it is "NULL" . When non existing identifier is given, the value is set to default with warning. |
fill |
logical, if FALSE (default), values in sstable will be left intact,
if TRUE , fill.count is used to replace NA values according to the
last non-NA value in a given column of sstable |
digits |
NULL (default) is used when results are count data (eg. number of individuals). If result is
not integer, but digits=NULL , error message is given. If results are not of count type but some kind of measurements
(eg. biomass, containing decimals) digits can be used to set precision of the data representation,
in this case use integers (digits=0 results integers, digits=1 means 1 decimal, etc.). |
x |
an object of class 'sscount'. |
... |
other arguments. |
When the zc
zero count identifier is used, respective rows in the segment column of the result will be replaced by NA
s, and count
values with 1
. Segment levels are also modifed accordingly.
A result is an object of class 'sscount'.
data |
data frame with columns sample , species , segment , count .
First three columns are factors, count is numeric. |
call |
returns the call. |
zc |
flag for rows with 0 total count, zc="zero.count" . |
digits |
stores value of digits argument, when digits is not NULL and data are of
count type it is set to NULL . |
nsamples |
number of samples (levels) in data column sample . |
nspecies |
number of species (levels) in data column species ,
"pseudo-species" created by zc is excluded. |
segment.levels |
list of levels in data column segment . |
Peter Solymos, Solymos.Peter@aotk.szie.hu, http://www.univet.hu/users/psolymos/personal/
drtsscount
, fill.count
, inflate
, sscount
,
ttsscount
### 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") sscount(ss) sscount(ss, zc="zero.count") sscount(ss[,c(1,2,4)], zc="zero.count") ss[,4] <- ss[,4] + 0.23 sscount(ss, digits=0) sscount(ss, digits=1) sscount(ss, digits=2) ### Example 2: field data of the dolina ## Not run: data(dol.count, dol.sample, landsnail) sscount(dol.count, zc="zero.count", fill=TRUE) ## End(Not run)