Everything was applied as zero. I mean, all values were zeros on "tax".
The data on "z13" is integer type. I can run the code, but I think the correct way is always use is.na or !is.na
Can you guide me what am I doing wrong on the second code chunk?
Thanks for your help and time.
Have a nice weekend.
you should consider your heirarchy when your case_when possibilities are overlapping..
not being NA overlaps with z13 being between 2 and 5. Therefore it gets assigned first.
change the order for different results, if you need not being NA to be a fallback if the other two options dont match, make it the 3rd option rather than the 1st. In case_when you often will apply a fallback if your earlier options do not exhaust all possibilities, this can be done by using the logical symbol TRUE as what to match on.
Thanks, nirgrahamuk.
The issue is I am translating some STATA code into tidyverse. An official syntax from a survey.
The issue arises when I deal with the management of missing values. Stata is very different than R working NA with. It's usual to generate variables in Stata as some value only if there is non missing values in a specific column. Translating that in R always gives me problems.
Thanks again, nirgrahamuk.