I am trying to run a KS test on a vector to check if its follows a Poisson distribution
require("MASS")
Data <- rpois(100000, 20)
distFit<-fitdistr(Data,"Poisson")
ks.test(Data,"ppois",lambda=distFit$estimate)
unfortunately I get the following message once I run ks.test in the next step
Warning message: In ks.test(Data, "ppois", lambda = distFit$estimate) : ties should not be present for the Kolmogorov-Smirnov test
Any idea how to fix this?