Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerlmichael committed Nov 14, 2024
1 parent a6a87fc commit 95ef00e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pipeline/00-ingest.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,21 @@ training_data_clean <- training_data_fil %>%
# Assign 'Non-livable area' to the first available outlier reason column
# as to not replace
sv_outlier_reason1 = case_when(
meta_modeling_group == "NONLIVABLE" & is.na(sv_outlier_reason1) ~ "Non-livable area",
meta_modeling_group == "NONLIVABLE" &
is.na(sv_outlier_reason1) ~ "Non-livable area",
TRUE ~ sv_outlier_reason1
),
sv_outlier_reason2 = case_when(
meta_modeling_group == "NONLIVABLE" & is.na(sv_outlier_reason1) & is.na(sv_outlier_reason2) ~ "Non-livable area",
meta_modeling_group == "NONLIVABLE" &
is.na(sv_outlier_reason1) &
is.na(sv_outlier_reason2) ~ "Non-livable area",
TRUE ~ sv_outlier_reason2
),
sv_outlier_reason3 = case_when(
meta_modeling_group == "NONLIVABLE" & is.na(sv_outlier_reason1) & is.na(sv_outlier_reason2) & is.na(sv_outlier_reason3) ~ "Non-livable area",
meta_modeling_group == "NONLIVABLE" &
is.na(sv_outlier_reason1) &
is.na(sv_outlier_reason2) &
is.na(sv_outlier_reason3) ~ "Non-livable area",
TRUE ~ sv_outlier_reason3
)
) %>%
Expand Down Expand Up @@ -593,7 +599,11 @@ training_data_w_strata <- training_data_clean %>%
.before = starts_with("ind_")
) %>%
mutate(sv_is_outlier = if_else(
sv_outlier_reason1 %in% c("Non-livable area", "High price (multi)", "Low price (multi)"),
sv_outlier_reason1 %in% c(
"Non-livable area",
"High price (multi)",
"Low price (multi)"
),
TRUE,
FALSE
)) %>%
Expand Down

0 comments on commit 95ef00e

Please sign in to comment.