I want to replace missing or N/A values in a csv file with mode. The column consists of strings. Column name is "embarked". I tried this
embarked.mode <- mode(data$Embarked, na.rm=TRUE)
data$Embarked[is.na(data$Embarked)] = embarked.mode
I am getting the following error
Error in mode(data$Embarked, na.rm = TRUE) :
unused argument (na.rm = TRUE)
Please help me how to replace them with mode without impute.