Hello, I'm very new to R and need some general help to get started in R studio.
I need to create a new variable called cd4cat defined as 0 if cd4< 100, 1 if cd4 ∈ [100, 199]
and 2 if cd4 ≥ 200. I've been told to literally type in create a new variable named cd4cat and it just got a big red X next to it so any assistance is appreciated. Below is where I'm at so far.
but got tripped using the @ operator in place of $
ACTG175$cd4cat[ACTG175@cd40<100]=0
Error in ACTG175$cd4cat[ACTG175@cd40 < 100] = 0 :
trying to get slot "cd40" from an object (class "data.frame") that is not an S4 object