Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend parse_family() to work with taxa above family #46

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

brownag
Copy link
Member

@brownag brownag commented Nov 13, 2023

Now gives more complete results when parse_family() is called on a heterogeneous vector of taxonomic class names, some of which may be taxa above family.

suppressPackageStartupMessages(library(soilDB))
library(SoilTaxonomy)

x <- data.frame(
  taxonname = c("Alberti", "Aquents", "Lithic Xeric Torriorthents", "Stagy Family", "Haplodurids"),
  taxonkind = c("series", "taxon above family", "taxon above family", "family", "taxon above family"),
  taxclname = c(
    "Clayey, smectitic, thermic, shallow Vertic Rhodoxeralfs", # Full family name
    "Aquents",                                                 # Taxon above subgroup
    "Lithic Xeric Torriorthents",                              # Subgroup
    "Coarse-loamy, mixed, mesic Duric Haploxerolls",           # Fill family name (missing activity)
    "Mixed, superactive, thermic Haplodurids"                  # Taxon above family (family class + great group)
  ))
parse_family(x$taxclname)
#>                                                    family
#> 1 Clayey, smectitic, thermic, shallow Vertic Rhodoxeralfs
#> 2                                                    <NA>
#> 3                                                    <NA>
#> 4           Coarse-loamy, mixed, mesic Duric Haploxerolls
#> 5                 Mixed, superactive, thermic Haplodurids
#>                                                 taxclname
#> 1 Clayey, smectitic, thermic, shallow Vertic Rhodoxeralfs
#> 2                                                 Aquents
#> 3                              Lithic Xeric Torriorthents
#> 4           Coarse-loamy, mixed, mesic Duric Haploxerolls
#> 5                 Mixed, superactive, thermic Haplodurids
#>                    taxonname subgroup_code code
#> 1        vertic rhodoxeralfs          JDEB JDEB
#> 2                    aquents          <NA>   LB
#> 3 lithic xeric torriorthents          LECB LECB
#> 4         duric haploxerolls          IFFZ IFFZ
#> 5                haplodurids          <NA>  GCC
#>                          class_string classes_split  taxpartsize taxpartsizemod
#> 1 Clayey, smectitic, thermic, shallow  Clayey, ....       clayey             NA
#> 2                                                           <NA>             NA
#> 3                                                           <NA>             NA
#> 4          Coarse-loamy, mixed, mesic  Coarse-l.... coarse-loamy             NA
#> 5         Mixed, superactive, thermic  Mixed, s....         <NA>             NA
#>   taxminalogy  taxceactcl taxreaction taxtempcl taxfamhahatmatcl taxfamother
#> 1   smectitic        <NA>          NA   thermic               NA     shallow
#> 2        <NA>        <NA>          NA      <NA>               NA        <NA>
#> 3        <NA>        <NA>          NA      <NA>               NA        <NA>
#> 4       mixed        <NA>          NA     mesic               NA        <NA>
#> 5       mixed superactive          NA   thermic               NA        <NA>
#>                    taxsubgrp   taxgrtgroup taxsuborder  taxorder
#> 1        Vertic Rhodoxeralfs  Rhodoxeralfs     Xeralfs  Alfisols
#> 2                       <NA>          <NA>     Aquents  Entisols
#> 3 Lithic Xeric Torriorthents Torriorthents    Orthents  Entisols
#> 4         Duric Haploxerolls  Haploxerolls     Xerolls Mollisols
#> 5                       <NA>   Haplodurids      Durids Aridisols

@brownag brownag linked an issue Nov 13, 2023 that may be closed by this pull request
@brownag brownag merged commit d04c9b0 into master Nov 13, 2023
5 of 6 checks passed
@brownag brownag deleted the parse-taxaabovefam branch November 13, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parse_family() with taxa above family
1 participant