I want to clean my dataset, putting "0" where I have "NA" value. My code is:
library(dplyr) data <- starwars data_clean <- data[is.na(data)] <- 0
This don't work because I have "na" values in both integer and character columns. Is there a way to clean my dataset?