I used the freq function of frequency package to get frequency percent on my dataset$MoriskyAdherence, then R gives me percent values with rounding. I need more decimal places.
MoriskyAdherence=dataset$MoriskyAdherence
freq(MoriskyAdherence)
The result is:
The Percent values are 35.5, 41.3,23.8. The sum of them is 100.1. The exact amounts should be 35.5, 41.25, 23.75.
What should I do? I used sprintf, as.data.frame,formatC, and some other function to deal with it.But...