เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Validating age

Now that you found some inconsistencies in the total amounts, you're suspicious that there may also be inconsistencies in the acct_agecolumn, and you want to see if these inconsistencies are related. Using the skills you learned from the video exercise, you'll need to validate the age of each account and see if rows with inconsistent acct_ages are the same ones that had inconsistent totals

dplyr and lubridate are loaded, and accounts is available.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Cleaning Data in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Create a new column called theoretical_age that contains the age of each account based on the date_opened.
  • Find the accounts where the acct_age doesn't match the theoretical_age.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Find invalid acct_age
accounts %>%
  # theoretical_age: age of acct based on date_opened
  mutate(theoretical_age = ___) %>%
  # Filter for rows where acct_age is different from theoretical_age
  ___
แก้ไขและรันโค้ด