Hi @evanp002! Welcome!
Since it sounds like you might be working on an assignment for a class, please take a look at our guidelines for asking questions about course work. We have a few rules we need you to follow (including not posting word-for-word assignment text), and that article also has some helpful advice.
There are many ways to recode data in R, so the best answer for you will depend on what you're currently learning. If you've been working with the tidyverse
and/or dplyr
packages, then you might approach the problem this way. If you've been learning about base R's tools for subsetting and manipulating data, then you might tackle it a different way.