# A tibble: 5 × 2
x y
<dbl> <chr>
1 1 a
2 1 a
3 1 b
4 2 b
5 2 b
Lecture 16
College of Idaho
CSCI 2025 - Winter 2026
NA.NA)is.na()NA if any input is NA.na.rm = TRUE to remove NAs before computation in functions like mean(), sum(), etc.tidyr::fill()coalesce() and na_if()dplyr::coalesce() replaces NAs with values from another vector.dplyr::na_if() replaces a specific value with NA.NAs Explicittidyr::complete()complete() turns implicit missing values into explicit NAs by completing the full range of data.NaNNaN)NaN (“Not a Number”) is a special numeric value that can arise from invalid mathematical operations, like 0/0.is.nan() tests for NaN.NaN is also considered NA, so is.na(NaN) is TRUE.Let’s practice!