I am working on a dataset with few missing values marked as "?", I have to replace them with the most common value(mode) of that column. But, I want to write a code which runs it for the whole dataset at once.
I have gotten so far -
df <- read.csv("mushroom.txt", na.strings = "?",header=FALSE)
Now, trying to replace all the NA values in the file with the mode of that column. Please help.