Reputation: 97
I am trying to use recode
function for demarcation of value in a variable but am not able to do so with a specific variable only where as it is working fine for another variable.
recode(age, age > 60, NA)
Error in recode.default(age, age > 60, NA) : object '.data' not found
What to do?
Upvotes: 0
Views: 103
Reputation: 226532
I think you could just do
age[age>60] <- NA
Note that epicalc is somewhat obsolete .... It looks like epicalc operates by default on a data frame called .data, which could make things difficult ...
Upvotes: 1