replace_na

# Step 1: Load the dplyr package
library(dplyr)

# Step 2: Create a sample data frame (replace this with your actual data frame)
data <- data.frame(
  ID = c(1, 2, 3, NA, 5),
  Value = c(10, NA, 30, 40, 50)
)

# Step 3: Use replace_na function from tidyr to replace NAs with a specified value (e.g., 0)
data <- data %>%
  tidyr::replace_na(list(Value = 0))