You should use a reprex for your example, that way you would know that your code as is is not runable. mledata is not defined.
You should include meldata or a toy equivalent so that we can run your code and see the results your are getting.
Here is a pointer to reprex's https://www.tidyverse.org/help/
We really need concrete, run-able examples in a reprex to be able to help you.
If you are having any trouble getting a reprex to work please post a new topic with the issues you are having. You will get a lot of help getting it to work for you.
Thanks