fill.count {mefa} | R Documentation |
This function replaces NA
values according to the last non-NA
value in a given column of a table.
fill.count(table)
table |
a matrix or data frame. |
It is easy and convinient way to fill up values in a data table with non-redundant entries, eg. leaving empty spaces just like on a sheet of a notebook. By this function, such objects can be directly used in subsequent operations, eg. by function sscount
.
A result is a matrix or data frame according to class of table
.
Peter Solymos, Solymos.Peter@aotk.szie.hu, http://www.univet.hu/users/psolymos/personal/
### Example 1: simple atrificial data ss <- data.frame( cbind( c("sample1",NA,"sample2",NA,"sample3","sample4"), c("species1",NA,"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") ss fill.count(ss) sscount(fill.count(ss), zc="zero.count") ## equivalent as sscount(ss, zc="zero.count", fill=TRUE) ### Example 2: field data of the dolina ## Not run: data(dol.count) dol.count fill.count(dol.count) ## End(Not run)