# Find invalid totals
accounts %>%
# theoretical_total: sum of the three funds
mutate(theoretical_total=fund_A+fund_B+fund_C) %>%
# Find accounts where total doesn't match theoretical_total
filter(theoretical_total != total)
I just replace + with sum, but I didn't get the right result. Why?
# Find invalid totals
accounts %>%
# theoretical_total: sum of the three funds
mutate(theoretical_total=sum(fund_A, fund_B, fund_C)) %>%
# Find accounts where total doesn't match theoretical_total
filter(theoretical_total != total)