Recoding variables in a data frame

Hi again, I tried to recode variables in my dataset using the follwing code

ckd[ckd$`seen filter`==1,]$`seen filter` <- "yes"
 This is what I got

Error in `[<-.data.frame`(`*tmp*`, ckd$`seen filter` == 1, , value = list( : 
  missing values are not allowed in subscripted assignments of data frames

How can I remove NAs here inside this code

I think we need to see more of your code and some sample data.

Hi @rasuranasinghe,
I suspect you need to change your code to this:

ckd$`seen filter`[ckd$`seen filter`==1] <- "yes"

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.