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

expand_types(): add support to expand 5130_hei #143

Merged
merged 1 commit into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion R/datawrangling.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#' to be met:
#' \itemize{
#' \item{for 2330: both subtype codes must be present}
#' \item{for 5130: 5130_hei must be present (note that only the main type code
#' occurs in the targeted data sources)}
#' \item{for 6230: 6230_ha, 6230_hmo and 6230_hnk must be present
#' (not the rare 6230_hnk)}
#' \item{for 91E0: 91E0_va, 91E0_vm and 91E0_vn must be present
Expand All @@ -39,7 +41,7 @@
#' This will add the main type code whenever \emph{one} corresponding subtype
#' code is present.
#' In all cases no other main type codes are added apart from
#' 2330, 6230 and 91E0.
#' 2330, 5130, 6230 and 91E0.
#' This is because the data sources with which the result
#' is to be matched (see Description) don't contain certain main type codes,
#' and because it makes no sense in other cases
Expand Down Expand Up @@ -90,6 +92,7 @@
#' "2190", 45,
#' "2330_bu", 8,
#' "2330_dw", 8,
#' "5130_hei", 7,
#' "6410_mo", 78,
#' "6410_ve", 4,
#' "91E0_vn", 10
Expand Down Expand Up @@ -211,6 +214,7 @@ expand_types_plain <- function(x,
subtypes %>%
filter(.data$main_type == "2330" |
.data$type %in% c("6230_ha", "6230_hmo", "6230_hnk",
"5130_hei",
"91E0_va", "91E0_vm", "91E0_vn")) %>%
left_join(orig_types %>%
mutate(present = 1),
Expand Down
5 changes: 4 additions & 1 deletion man/expand_types.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.