i am trying to replace all the question mark in a data frame ,so i can do future data preprocessing,I tried sevral methods but all won't work.
i tried to traverse all the data in data frame and replace "?" with NA(that is what i used to do in python)
replace.question.mark <- function (df) {
for(i in 1:nrow(df)){
for(ii in 1:ncol(df)){
df[i,ii]<-replace(df[i,ii],df[i,ii]=="?",NA)
}
}
}
I expect to replace all the "?" with NA,but the output is just null