Find centralized, trusted content and collaborate around the technologies you use most.
Learn moreTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn morePlease read about [how to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
) and update your question accordingly. Include a sample of your data by pasting the output of `dput(<your data frame>)` into your post or `dput(head(<your data frame>))` if you have a large data frame. Also include code you have tried, any relevant errors, and expected output. If you cannot post your data, then please post code for creating representative data.
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.