bold_filter {bold} | R Documentation |
Filter BOLD specimen + sequence data (output of bold_seqspec)
Description
Picks either shortest or longest sequences, for a given grouping variable (e.g., species name)
Usage
bold_filter(x, by, how = "max", returnTibble = TRUE)
Arguments
x |
(data.frame) a data.frame, as returned from
|
by |
(character) the column by which to group. For example, if you want the longest sequence for each unique species name, then pass species_name. If the column doesn't exist, error with message saying so. Required. |
how |
(character) one of "max" or "min", which get used as
|
returnTibble |
Whether the output should be a tibble or
a data.frame. Default is TRUE, but verifies that the |
Value
a data.frame
Examples
## Not run:
res <- bold_seqspec(taxon = 'Osmia')
maxx <- bold_filter(res, by = "species_name")
minn <- bold_filter(res, by = "species_name", how = "min")
vapply(maxx$nucleotides, nchar, 1, USE.NAMES = FALSE)
vapply(minn$nucleotides, nchar, 1, USE.NAMES = FALSE)
## End(Not run)