data9
data9

Reputation: 97

Error in recoding function from package epicalc

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

With out any error

Giving error

What to do?

Upvotes: 0

Views: 103

Answers (1)

Ben Bolker
Ben Bolker

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

Related Questions