Hi @Hami,
Could you also provide a sample of your dataset. Without the data, it would be difficult to help you with the code. You could use the dput(your_data_here)
to share your data. If it is too big, then you could use a subset of a few rows: dput(your_data_here[1:50, ])
.
This great article here talk about how to make a reproducible example, which is what I am essentially asking you: FAQ: How to do a minimal reproducible example ( reprex ) for beginners