Skip to content

Commit

Permalink
Merge pull request #25 from SzarR/step_dues_V2
Browse files Browse the repository at this point in the history
Update step_dues due to changes in dues data
  • Loading branch information
fxqmu authored Feb 6, 2024
2 parents 9e8fc74 + c93155f commit 67ba4ff
Showing 1 changed file with 14 additions and 36 deletions.
50 changes: 14 additions & 36 deletions R/step_dues.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,27 @@ step_dues <- function(df, year) {
mutate(
Membership_Dues =
case_when(
ItemDescription == "Associate Dues" ~ 'Associate',
ItemDescription == "Associate Returning Dues" ~ 'Associate',
ItemDescription == "Associate Renewal Dues" ~ 'Associate',
ItemDescription == "Fellow Dues" ~ 'Fellow',
ItemDescription == "Fellow Renewal Dues" ~ 'Fellow',
ItemDescription == "Fellow Returning Dues" ~ 'Fellow',
ItemDescription == "International Affiliate Dues" ~ 'International Affiliate',
ItemDescription == "International Affiliate Renewal Dues" ~ 'International Affiliate',
ItemDescription == "New International Affiliate Dues" ~ 'International Affiliate',
ItemDescription == "Member Dues" ~ 'Member',
ItemDescription == "Member Renewal Dues" ~ 'Member',
ItemDescription == "Member Returning Dues" ~ 'Member',
ItemDescription == "New Associate Dues" ~ 'Associate',
ItemDescription == "New Member Dues" ~ 'Member',
ItemDescription == "New Student Affiliate Dues" ~ 'Student Affiliate',
ItemDescription == "New Student Dues" ~ 'Student Affiliate',
ItemDescription == "Pathway Upgrade to Member From Associate" ~ 'Member',
ItemDescription == "Retired Associate Dues" ~ 'Associate',
ItemDescription == "Retired Associate Renewal Dues" ~ 'Retired Associate',
ItemDescription == "Retired Associate Returning Dues" ~ 'Retired Associate',
ItemDescription == "Retired Dues" ~ 'Retired Member',
ItemDescription == "Retired Fellow Dues" ~ 'Retired Fellow',
ItemDescription == "Retired Fellow Renewal Dues" ~ 'Retired Fellow',
ItemDescription == "Retired Fellow Returning Dues" ~ 'Retired Fellow',
ItemDescription == "Retired International Affiliate Dues" ~ 'Retired International Affiliate',
ItemDescription == "Retired International Affiliate Renewal Dues" ~ 'Retired International Affiliate',
ItemDescription == "Retired Member Dues" ~ 'Retired Member',
ItemDescription == "Retired Member Renewal Dues" ~ 'Retired Member',
ItemDescription == "Retired Member Returning Dues" ~ 'Retired Member',
ItemDescription == "Student Affiliate Dues" ~ 'Student Affiliate',
ItemDescription == "Student Affiliate Renewal Dues" ~ 'Student Affiliate',
ItemDescription == "Student Affiliate Returning Dues" ~ 'Student Affiliate',
ItemDescription == "Upgrade to Associate from Student" ~ 'Associate',
ItemDescription == "Upgrade to Member from Associate" ~ 'Member',
ItemDescription == "Upgrade to Member from International Affiliate" ~ 'Member',
ItemDescription == "Upgrade to Member from Student" ~ 'Member'
str_detect(ItemDescription, "Retired") & str_detect(ItemDescription, "International") ~ "Retired International",
str_detect(ItemDescription, "Retired") & str_detect(ItemDescription, "Associate") ~ "Retired Associate",
str_detect(ItemDescription, "Retired") & str_detect(ItemDescription, "Member") ~ "Retired Member",
str_detect(ItemDescription, "Retired") & str_detect(ItemDescription, "Fellow") ~ "Retired Fellow",
str_detect(ItemDescription, "International") & str_detect(ItemDescription, "Affiliate") ~ "International Affiliate",
str_detect(ItemDescription, "International") & str_detect(ItemDescription, "Associate") ~ "International Associate",
str_detect(ItemDescription, "Upgrade to Associate") ~ "Associate",
str_detect(ItemDescription, "Upgrade to Member") ~ "Member",
str_detect(ItemDescription, "Student") ~ "Student Affiliate",
str_detect(ItemDescription, "Affiliate") ~ "Affiliate",
str_detect(ItemDescription, "Associate") ~ "Associate",
str_detect(ItemDescription, "Member") ~ "Member",
str_detect(ItemDescription, "Fellow") ~ "Fellow"
)
) %>%
mutate(
MD_Number =
case_when(
Membership_Dues == "Student Affiliate" ~ 1,
Membership_Dues == "Associate" ~ 2,
Membership_Dues == "Affiliate" ~ 2,
Membership_Dues == "International Affiliate" ~ 3,
Membership_Dues == "International Associate" ~ 3,
Membership_Dues == "Member" ~ 4,
Expand Down

0 comments on commit 67ba4ff

Please sign in to comment.