NA, NULL and Missing Values
NA marks missing data and NULL is nothing. Many functions need na.rm = TRUE.
Example
x <- c(1, NA, 3)
print(is.na(x))
print(sum(x))
print(sum(x, na.rm = TRUE))
print(mean(x, na.rm = TRUE))
print(is.null(NULL))Exercise
Ignore NA.
sum(x, = TRUE)
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.