Select a range of taxa, either by two names, or relational operators
span(.data, ...)
.data | Input, object of class |
---|---|
... | quoted rank names (e.g., family) via |
an object of the same class as passed in
supports Hierarchy
and hierarchies
objects
See filtering-helpers, including for more explanation of how this function works.
# Hierarchy class ex_hierarchy1#> <Hierarchy> #> no. taxon's: 3 #> Poaceae / family / 4479 #> Poa / genus / 4544 #> Poa annua / species / 93036#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544#> <Hierarchy> #> no. taxon's: 2 #> Poa / genus / 4544 #> Poa annua / species / 93036#> <Hierarchy> #> no. taxon's: 1 #> Poaceae / family / 4479#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544#> <Hierarchy> #> no. taxon's: 1 #> Poa annua / species / 93036#> <Hierarchy> #> no. taxon's: 2 #> Poa / genus / 4544 #> Poa annua / species / 93036#> <Hierarchy> #> no. taxon's: 1 #> Felidae / family / 9681#> <Hierarchy> #> no. taxon's: 2 #> Felidae / family / 9681 #> Puma / genus / 146712#> <Hierarchy> #> no. taxon's: 1 #> Puma concolor / species / 9696#> <Hierarchy> #> no. taxon's: 2 #> Puma / genus / 146712 #> Puma concolor / species / 9696#> <Hierarchy> #> no. taxon's: 2 #> Puma / genus / 146712 #> Puma concolor / species / 9696#> <Hierarchy> #> no. taxon's: 2 #> Puma / genus / 146712 #> Puma concolor / species / 9696## Multiple operator statements - useful with larger classifications ex_hierarchy3#> <Hierarchy> #> no. taxon's: 6 #> Chordata / phylum / 158852 #> Vertebrata / subphylum / 331030 #> Teleostei / class / 161105 #> Salmonidae / family / 161931 #> Salmo / genus / 161994 #> Salmo salar / species / 161996#> <Hierarchy> #> no. taxon's: 3 #> Vertebrata / subphylum / 331030 #> Teleostei / class / 161105 #> Salmonidae / family / 161931#> <Hierarchy> #> no. taxon's: 3 #> Vertebrata / subphylum / 331030 #> Teleostei / class / 161105 #> Salmonidae / family / 161931## taxon names ### keep all taxa between Poaceae and Poa ### - matches to ranks first ex_hierarchy1 %>% span(nms("Poaceae", "Poa"))#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544## taxon ids ### keep all taxa between 4479 and 4544 taxonomic IDs ### - matches to ranks first ex_hierarchy1 %>% span(ids(4479, 4544))#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544#> <Hierarchy> #> no. taxon's: 3 #> Poaceae / family / 4479 #> Poa / genus / 4544 #> Poa annua / species / 93036 #> <Hierarchy> #> no. taxon's: 3 #> Felidae / family / 9681 #> Puma / genus / 146712 #> Puma concolor / species / 9696 #> <Hierarchy> #> no. taxon's: 6 #> Chordata / phylum / 158852 #> Vertebrata / subphylum / 331030 #> Teleostei / class / 161105 #> Salmonidae / family / 161931 #> Salmo / genus / 161994 #> Salmo salar / species / 161996#> <Hierarchy> #> no. taxon's: 2 #> Poaceae / family / 4479 #> Poa / genus / 4544 #> <Hierarchy> #> no. taxon's: 2 #> Felidae / family / 9681 #> Puma / genus / 146712 #> <Hierarchy> #> no. taxon's: 2 #> Salmonidae / family / 161931 #> Salmo / genus / 161994