Skip to contents

Places each unit in one of three states from its count of resolved samples. A unit with no resolved samples is absent. A unit with fewer than min_samples resolved samples has too few for its percentage to be read as performance. Any other unit is measured.

Usage

es_sample_state(
  n,
  min_samples = 5L,
  measured_label = "Measured",
  thin_label = "Too few samples",
  absent_label = "No ES site"
)

Arguments

n

Integer vector of resolved sample counts.

min_samples

Fewest resolved samples for a percentage to be measured. Default 5.

measured_label, thin_label, absent_label

Labels for the three states. Defaults "Measured", "Too few samples" and "No ES site".

Value

A factor the length of n, with levels in the order measured, thin, absent.

Examples

es_sample_state(c(0, 3, 12))
#> [1] No ES site      Too few samples Measured       
#> Levels: Measured Too few samples No ES site