Please prepare a Reproducible Example (Reprex) for your question. We need to see the data in order to help you effectively.
Also, if your question is about a homework problem, please read the homework policy.