Commit 45cd4683 authored by Carl Corder's avatar Carl Corder
Browse files

change demographic filter logic

parent ef059688
......@@ -55,8 +55,8 @@ data <- data %>% filter(!is.na(INDUSTRY))
# left outer-join on demographics (age, gender & salary)
data <- merge(x = data, y = demographic, by.x = "GROUP_ID", by.y = "GROUP_ID", all.x = TRUE)
# remove groups without demographics
data <- data %>% filter(!is.na(AVG_AGE), !is.na(AVG_SALARY), !is.na(PCT_FEMALE))
# remove groups with missing demographics
data <- data %>% filter(!(is.na(AVG_AGE) | is.na(AVG_SALARY) | is.na(PCT_FEMALE)))
# append percent commission
data <- merge(x = data,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment