Imputing Missing Values in R

Data Science with R Programming 6 min min read Updated: Mar 07, 2026 Intermediate
Imputing Missing Values in R
Intermediate Topic 4 of 10

Imputation

Instead of removing missing values, we can replace them with mean or median values.

r data$age[is.na(data$age)] <- mean(data$age, na.rm=TRUE)

Next Tutorial: Removing Duplicates

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators