Recall & Review
beginner
What does the
drop_na() function do in R?It removes rows from a data frame that contain any missing values (
NA). This helps clean data by keeping only complete cases.Click to reveal answer
beginner
How does
fill() help with missing values in R?The
fill() function fills missing values (NA) in a column by carrying the last non-missing value forward or backward, useful for filling gaps in data.Click to reveal answer
beginner
What package do
drop_na() and fill() come from?They are part of the
tidyr package, which helps tidy and clean data in R.Click to reveal answer
intermediate
What happens if you use
drop_na() without any arguments?It removes all rows that have any missing value in any column of the data frame.
Click to reveal answer
intermediate
How can you fill missing values only in specific columns using
fill()?You specify the column names inside
fill(), like fill(data, column1, column2), to fill missing values only in those columns.Click to reveal answer
What does
drop_na() do by default?✗ Incorrect
drop_na() removes rows that have any NA values by default.
Which package provides
fill() and drop_na() functions?✗ Incorrect
Both functions are part of the tidyr package.
How does
fill() fill missing values by default?✗ Incorrect
fill() carries the last non-missing value forward by default.
If you want to remove rows with missing values only in column
age, how do you use drop_na()?✗ Incorrect
Specifying the column name removes rows with missing values only in that column.
What is a common use case for
fill()?✗ Incorrect
fill() is often used to fill gaps in time series by carrying the last known value forward.
Explain how
drop_na() and fill() help handle missing values in R.Think about removing vs filling missing data.
You got /3 concepts.
Describe a situation where you would use
fill() instead of drop_na().Consider when data loss is a problem.
You got /3 concepts.