Skip to content

Commit 736c207

Browse files
committed
extractSMR: add support for SMR described only at subgroup level
1 parent dff0043 commit 736c207

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

R/extractSMR.R

+13-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extractSMR <- function(taxon, as.is = FALSE, droplevels = FALSE, ordered = TRUE)
3737
co <- .get_SMR_element_connotation()
3838

3939
# only consider SMR formative elements at or below taxon level
40-
el$defs <- el$defs[el$defs$element %in% co$element & th <= el$defs$level,]
40+
el$defs <- el$defs[el$defs$element %in% co$element & th <= el$defs$level, ]
4141

4242
# THEN get highest level taxon SMR connotation
4343
co <- co[co$element %in% el$defs$element &
@@ -51,11 +51,18 @@ extractSMR <- function(taxon, as.is = FALSE, droplevels = FALSE, ordered = TRUE)
5151
}
5252

5353
.get_SMR_element_connotation <- function() {
54-
# x <- get_ST_formative_elements()
55-
# x[grepl("SMR|wetness", x$connotation) & x$level != "subgroup",][c("element","level")]
5654
## NB: currently there is no formative element connotation for "peraquic" soils
57-
data.frame(element = c("per", "ids", "aqu", "torr", "ud", "ust", "xer", "torri", "ud", "ust", "xer", "aqu"),
58-
level = c("suborder", "order", "suborder", "suborder", "suborder", "suborder", "suborder", "greatgroup", "greatgroup", "greatgroup", "greatgroup", "greatgroup"),
59-
connotation = c("perudic", "aridic (torric)", "aquic", "aridic (torric)", "udic", "ustic", "xeric", "aridic (torric)", "udic", "ustic", "xeric", "aquic"),
55+
data.frame(element = c("per", "ids", "aqu", "torr", "ud",
56+
"ust", "xer", "torri", "ud", "ust",
57+
"xer", "aqu", "udic", "ustic", "xeric",
58+
"aquic"),
59+
level = c("suborder", "order", "suborder", "suborder", "suborder",
60+
"suborder", "suborder", "greatgroup", "greatgroup", "greatgroup",
61+
"greatgroup", "greatgroup", "subgroup", "subgroup", "subgroup",
62+
"subgroup"),
63+
connotation = c("perudic", "aridic (torric)", "aquic", "aridic (torric)", "udic",
64+
"ustic", "xeric", "aridic (torric)", "udic", "ustic",
65+
"xeric", "aquic", "udic", "ustic", "xeric",
66+
"aquic"),
6067
stringsAsFactors = FALSE)
6168
}

0 commit comments

Comments
 (0)