I\'m trying calculate an optimal sample size for a large data and in the formula of sample size, I need to estimate the density of data. I use density() function and then put it