Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
28. Exercise 3




As you can tell, the built and last_renovation columns are not populated for several observations. Let's assume that such houses are very old. Replace all NAs in built with the oldest year that is stored under the built column. Then, replace all NA values in the last_renovation with the values stored under the built column.

Stuck? Here's a hint!

Find the oldest house with the min() function - set the optional na.rm argument to TRUE in order to omit NAs. Assign that min value to the built column for rows where$built) is equal to TRUE.

For the last_renovation column you need to find rows where$last_renovation) is equal to TRUE and then assign corresponding values from the built column.