Challenge: Clean Data

Follow the instructions to solve the challenge.

We'll cover the following

Find the total age

In this exercise, you need to calculate the total age of the people in the final data frame produced as a result of the instructions below. We use the infert dataset in this exercise. Follow the instructions step by step to reach the result:

  1. Call the dataset by typing infert.
  2. Convert the data in the case column into logical data types.
  3. Create a new column named age_status. Set the value in the new column as BA for every row in which the age of the person is below average. Otherwise, set the value as AA.
  4. Filter all rows with the age_status column equal to BA, the case column equal to TRUE, and the parity column not less than 4.
  5. Select the age column of the filtered data.

Finally, sum up all the values, and name the outcome result.

Get hands-on with 1200+ tech skills courses.