n_obs_1: Count observation assigned in [taxmap()]

View source: R/old_taxa--taxmap--s3.R

n_obs_1R Documentation

Count observation assigned in [taxmap()]

Description

Count observations for each taxon in a data set in a [taxmap()] object. This includes observations for the specific taxon but NOT the observations of its subtaxa. "Observations" in this sense are the items (for list/vectors) or rows (for tables) in a dataset. By default, observations in the first data set in the [taxmap()] object is used. For example, if the data set is a table, then a value of 3 for a taxon means that their are 3 rows in that table assigned to that taxon.

obj$n_obs_1(data)
n_obs_1(obj, data)

Arguments

obj

([taxmap()])

data

Dataset name, index, or a logical vector that indicates which dataset in 'obj$data' to add columns to.

target

DEPRECIATED. use "data" instead.

Value

'numeric'

See Also

Other taxmap data functions: n_obs()

Examples

# Get number of observations for each taxon in first dataset
n_obs_1(ex_taxmap)

# Get number of observations in a specified data set
n_obs_1(ex_taxmap, "info")
n_obs_1(ex_taxmap, "abund")

# Filter taxa using number of observations in the first table
filter_taxa(ex_taxmap, n_obs_1 > 0)


metacoder documentation built on April 4, 2023, 9:08 a.m.