Hi, and welcome to community.rstudio.com! Without knowing what your data looks like, it's a little hard to answer your question. To help you get the right help for your question, can you please turn it into a reprex (reproducible example)? This will ensure we're all looking at the same data and code. A guide for creating a reprex can be found here.
I suspect there may be something about the way your data is formatted that's causing the output you see.