Back to Practice
#0145
Remove Rows With Missing Values
EasyR15 min10 XP
Problem
Given a data frame df, return only rows that have no missing values.
Why This Matters
Before modeling or plotting, you often need to decide how missing rows are handled.
Examples
Example 1
Inputrows A=10, B=NA, C=30
Outputrows A and C
The row containing NA is removed.
Constraints
- Return the exact requested structure.
- Handle normal edge cases cleanly.
- Prefer readable code over clever shortcuts.
CodeR
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Inputrows A=10, B=NA, C=30
Expectedrows A and C
The row containing NA is removed.
Hidden Test Categories
no missing valuesmultiple columnsall rows missing