clean: Remove samples and taxons from a Dataset

View source: R/clean.r

cleanR Documentation

Remove samples and taxons from a Dataset

Description

Functions that will take a Dataset object, and remove samples and/or taxons with different criteria

Usage

clean(Dat, verbose = TRUE)

Arguments

Dat

A Dataset object

verbose

logical indicating whether to print info about the results.

Details

clean will remove any sample (column) or taxon (row) fromt your Dataset, that has no observations. Some functions like PCA and some linear models won't work if one of the rows or columns of the matrix are all zero, and so it is always a good idea to "clean" your dataset.

remove_samples and remove_taxons take respectively a list of samples or taxons to remove from the Dataset.

Value

A Dataset object

Author(s)

Sur Herrera Paredes

See Also

remove_taxons, remove_samples

Examples

data(Rhizo)
data(Rhizo.map)
Dat <- create_dataset(Rhizo,Rhizo.map)
Dat <- remove_samples(Dat,colnames(Dat$Tab)[1:50])
Dat <- remove_taxons(Dat,row.names(Dat$Tab)[1:115])
sum(colSums(Dat$Tab) == 0)
sum(rowSums(Dat$Tab) == 0)
Dat$Tab
Dat.clean <- clean(Dat)
Dat.clean$Tab

surh/AMOR documentation built on Feb. 21, 2023, 6:31 a.m.