Skip to content

Commit

Permalink
rebuild package data
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Jan 8, 2024
1 parent b8da563 commit 298fe1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions data-raw/package-datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,17 @@ usethis::use_data(ST_unique_list, overwrite = TRUE)
## formative element dictionaries
load('misc/formative-elements/formative-elements.rda')
ST_formative_elements <- ST.formative_elements
names(ST_formative_elements) <- c("order","suborder","greatgroup","subgroup")
names(ST_formative_elements) <- c("order", "suborder", "greatgroup", "subgroup")

# find formative elements in order names and add to table
y <- ST_formative_elements[["order"]]
res <- data.frame(y$order, stringr::str_locate(y$order, gsub("(.*)s$","\\1", y$element)))
colnames(res) <- c("order","element_start","element_end")
colnames(res) <- c("order", "element_start", "element_end")
ST_formative_elements[["order"]] <- merge(ST_formative_elements[["order"]], res, by = "order")

usethis::use_data(ST_formative_elements, overwrite = TRUE)

ST_feature_SKB <- jsonlite::read_json("https://github.com/ncss-tech/SoilKnowledgeBase/raw/main/inst/extdata/KST/2014_KST_EN_featurelist.json",
simplifyVector = TRUE)
ST_feature_SKB <- jsonlite::read_json("https://github.com/ncss-tech/SoilKnowledgeBase/raw/main/inst/extdata/KST/2014_KST_EN_featurelist.json", simplifyVector = TRUE)

# handle marked UTF8 strings
ST_feature_SKB$description <- sapply(ST_feature_SKB$description, stringi::stri_enc_toascii)
Expand Down
Binary file modified data/ST_formative_elements.rda
Binary file not shown.
8 changes: 4 additions & 4 deletions misc/formative-elements/extract-and-prepare-dictionaries.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ str(subgroup)

# pack into a list
ST.formative_elements <- list(
soilorder=soilorder,
suborder=suborder,
greatgroup=greatgroup,
subgroup=subgroup
soilorder = soilorder,
suborder = suborder,
greatgroup = greatgroup,
subgroup = subgroup
)

# try saving as JSON
Expand Down
Binary file modified misc/formative-elements/formative-elements.rda
Binary file not shown.

0 comments on commit 298fe1b

Please sign in to comment.