From d6e1c11154627025caf3a8b0368945be1f124e28 Mon Sep 17 00:00:00 2001 From: "Andrew G. Brown" Date: Wed, 25 Oct 2023 16:50:01 -0700 Subject: [PATCH 1/2] add support for single digit pH - not super common, but possible --- R/parseOSD_functions.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/parseOSD_functions.R b/R/parseOSD_functions.R index 7c2a7aadb4..770befad48 100644 --- a/R/parseOSD_functions.R +++ b/R/parseOSD_functions.R @@ -168,7 +168,7 @@ .parse_pH <- function(text) { # combine into capturing REGEX - ph.regex <- '\\(ph\\s?([0-9]\\.[0-9])\\)' + ph.regex <- '\\(ph\\s?([0-9]\\.?[0-9]?)\\)' # get matches m <- stringi::stri_match(text, regex = ph.regex, mode = 'first', opts_regex = list(case_insensitive = TRUE)) From 1bcb8bb62eeec7e0d458b17aad6a56449756b554 Mon Sep 17 00:00:00 2001 From: SoilKnowledgeBot Date: Thu, 26 Oct 2023 00:18:19 +0000 Subject: [PATCH 2/2] Update inst/extdata/ JSON files --- inst/extdata/OSD/E/ETACH.json | 2 +- inst/extdata/OSD/F/FLATBUSH.json | 2 +- inst/extdata/OSD/G/GRAFEN.json | 2 +- inst/extdata/OSD/H/HEREFORD.json | 2 +- inst/extdata/OSD/H/HIVAL.json | 2 +- inst/extdata/OSD/M/MARINEPARK.json | 4 ++-- inst/extdata/OSD/M/MECCAPASS.json | 2 +- inst/extdata/OSD/R/RIRIE.json | 2 +- inst/extdata/OSD/T/TUFFIT.json | 2 +- inst/extdata/OSD/T/TURPIN.json | 2 +- inst/extdata/OSD/T/TWICK.json | 2 +- inst/extdata/OSD/V/VYLACH.json | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/inst/extdata/OSD/E/ETACH.json b/inst/extdata/OSD/E/ETACH.json index 64131dd1c7..bd6f3df3be 100644 --- a/inst/extdata/OSD/E/ETACH.json +++ b/inst/extdata/OSD/E/ETACH.json @@ -110,7 +110,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "very gravelly", - "pH": "NA", + "pH": 5, "pH_class": "very strongly acid", "eff_class": "NA", "distinctness": "abrupt", diff --git a/inst/extdata/OSD/F/FLATBUSH.json b/inst/extdata/OSD/F/FLATBUSH.json index 5c5e31f60d..0b5871614e 100644 --- a/inst/extdata/OSD/F/FLATBUSH.json +++ b/inst/extdata/OSD/F/FLATBUSH.json @@ -110,7 +110,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 5, "pH_class": "very strongly acid", "eff_class": "NA", "distinctness": "clear", diff --git a/inst/extdata/OSD/G/GRAFEN.json b/inst/extdata/OSD/G/GRAFEN.json index 58ee49b221..e4874eebe5 100644 --- a/inst/extdata/OSD/G/GRAFEN.json +++ b/inst/extdata/OSD/G/GRAFEN.json @@ -110,7 +110,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "extremely stony", - "pH": "NA", + "pH": 7, "pH_class": "neutral", "eff_class": "NA", "distinctness": "clear", diff --git a/inst/extdata/OSD/H/HEREFORD.json b/inst/extdata/OSD/H/HEREFORD.json index 161bf36cc2..28d0d36ab1 100644 --- a/inst/extdata/OSD/H/HEREFORD.json +++ b/inst/extdata/OSD/H/HEREFORD.json @@ -133,7 +133,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 8, "pH_class": "moderately alkaline", "eff_class": "noneffervescent", "distinctness": "clear", diff --git a/inst/extdata/OSD/H/HIVAL.json b/inst/extdata/OSD/H/HIVAL.json index 748331f26d..49e3a889e8 100644 --- a/inst/extdata/OSD/H/HIVAL.json +++ b/inst/extdata/OSD/H/HIVAL.json @@ -110,7 +110,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 8, "pH_class": "moderately alkaline", "eff_class": "NA", "distinctness": "clear", diff --git a/inst/extdata/OSD/M/MARINEPARK.json b/inst/extdata/OSD/M/MARINEPARK.json index 0072516598..f3881de95f 100644 --- a/inst/extdata/OSD/M/MARINEPARK.json +++ b/inst/extdata/OSD/M/MARINEPARK.json @@ -87,7 +87,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 5, "pH_class": "very strongly acid", "eff_class": "NA", "distinctness": "clear", @@ -110,7 +110,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "gravelly", - "pH": "NA", + "pH": 5, "pH_class": "very strongly acid", "eff_class": "NA", "distinctness": "clear", diff --git a/inst/extdata/OSD/M/MECCAPASS.json b/inst/extdata/OSD/M/MECCAPASS.json index 8f09747da5..0e590f5fc1 100644 --- a/inst/extdata/OSD/M/MECCAPASS.json +++ b/inst/extdata/OSD/M/MECCAPASS.json @@ -156,7 +156,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "extremely gravelly", - "pH": "NA", + "pH": 8, "pH_class": "moderately alkaline", "eff_class": "violently effervescent", "distinctness": "clear", diff --git a/inst/extdata/OSD/R/RIRIE.json b/inst/extdata/OSD/R/RIRIE.json index 799fdcdaee..e5734b432a 100644 --- a/inst/extdata/OSD/R/RIRIE.json +++ b/inst/extdata/OSD/R/RIRIE.json @@ -225,7 +225,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 9, "pH_class": "very strongly alkaline", "eff_class": "strongly effervescent", "distinctness": "NA", diff --git a/inst/extdata/OSD/T/TUFFIT.json b/inst/extdata/OSD/T/TUFFIT.json index 832b07a855..2593f989e6 100644 --- a/inst/extdata/OSD/T/TUFFIT.json +++ b/inst/extdata/OSD/T/TUFFIT.json @@ -133,7 +133,7 @@ "moist_rupture": "friable", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 9, "pH_class": "NA", "eff_class": "NA", "distinctness": "NA", diff --git a/inst/extdata/OSD/T/TURPIN.json b/inst/extdata/OSD/T/TURPIN.json index d401e5013f..b3d6635c08 100644 --- a/inst/extdata/OSD/T/TURPIN.json +++ b/inst/extdata/OSD/T/TURPIN.json @@ -179,7 +179,7 @@ "moist_rupture": "NA", "coherence": "NA", "cf_class": "NA", - "pH": "NA", + "pH": 10, "pH_class": "very strongly alkaline", "eff_class": "violently effervescent", "distinctness": "NA", diff --git a/inst/extdata/OSD/T/TWICK.json b/inst/extdata/OSD/T/TWICK.json index 0e395d42c1..77aad05781 100644 --- a/inst/extdata/OSD/T/TWICK.json +++ b/inst/extdata/OSD/T/TWICK.json @@ -87,7 +87,7 @@ "moist_rupture": "firm", "coherence": "NA", "cf_class": "cobbly", - "pH": "NA", + "pH": 8, "pH_class": "moderately alkaline", "eff_class": "slightly effervescent", "distinctness": "abrupt", diff --git a/inst/extdata/OSD/V/VYLACH.json b/inst/extdata/OSD/V/VYLACH.json index 150a69d33f..0cdeb5b7ec 100644 --- a/inst/extdata/OSD/V/VYLACH.json +++ b/inst/extdata/OSD/V/VYLACH.json @@ -156,7 +156,7 @@ "moist_rupture": "firm", "coherence": "strongly cemented", "cf_class": "NA", - "pH": "NA", + "pH": 8, "pH_class": "moderately alkaline", "eff_class": "NA", "distinctness": "abrupt",