Hi, I have a dataframe like the one below. I want to make a new column called "Species". I then want to populate that column with either "species1" or "species2", depending on the end of the sample ID (in the ID column). I have an example below of what I have tried, trying to use mutate, ends_with, and if_else, but I haven't figured out how to make it work yet.
#example of failed code
a<- df %>%