lundi 27 septembre 2021

How do I replace values with text [closed]

I am new to using R and I am encountering a really annoying roadblock.

I am trying to use a dataset and convert all 0's to a value of "Not_Eaten' and all 1's to a value of eaten.

I am using this statement

attach(data)
Eaten <- ifelse(Survived =0, "Not_Eaten",'Eaten')````

but I keep getting the error 
````unused argument (Eaten= 0)````

Can someone please point out what I am doing wrong here?

If it helps, the class is integer and not numeric for some reason. 

Aucun commentaire:

Enregistrer un commentaire