Validating totals
In this lesson, you'll continue to work with the accounts data frame, but this time, you have a bit more information about each account. There are three different funds that account holders can store their money in. In this exercise, you'll validate whether the total amount in each account is equal to the sum of the amount in fund_A, fund_B, and fund_C. If there are any accounts that don't match up, you can look into them further to see what went wrong in the bookkeeping that led to inconsistencies.
dplyr is loaded and accounts is available.
Deze oefening maakt deel uit van de cursus
Cleaning Data in R
Oefeninstructies
- Create a new column called
theoretical_totalthat contains the sum of the amounts in each fund. - Find the accounts where the
totaldoesn't match thetheoretical_total.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Find invalid totals
accounts %>%
# theoretical_total: sum of the three funds
___ %>%
# Find accounts where total doesn't match theoretical_total
___