Skip to content

Instantly share code, notes, and snippets.

@lixzhang
Created September 1, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lixzhang/4cba1f64c57149e9ee3fa78a0102255f to your computer and use it in GitHub Desktop.
Save lixzhang/4cba1f64c57149e9ee3fa78a0102255f to your computer and use it in GitHub Desktop.
bank_count <- bank
bank_count$condition <- bank_count$Expense > 40
bank_count <- aggregate(bank_count$condition, by = list(bank_count$CardID), FUN = sum)
names(bank_count) <- c("CardID", "over_spend")
bank_count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment