title: Creating new variable based on few conditions
body: <p>In the attached image, I want to create two groups in R: If half of the days of any ID is &gt;=90, return A in New category, if else, return B in New Category. I also want to retain/return all other variables.</p>
  <p><a href="https://i.stack.imgur.com/Y0iNU.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I apologize, I am pretty new to R.</p>