vendredi 24 septembre 2021

Creating new variable based on few conditions

In the attached image, I want to create two groups in R: If half of the days of any ID is >=90, return A in New category, if else, return B in New Category. I also want to retain/return all other variables.

enter image description here

I apologize, I am pretty new to R.

Aucun commentaire:

Enregistrer un commentaire