stats::density() runs out of memory with very large datasets, but functions in the KernSmooth package seem like a good alternative—they are fast, accurate, and work with very large datasets. See more here: https://vita.had.co.nz/papers/density-estimation.pdf
https://github.com/wilkelab/ggridges/blob/a8a99820b131fb666aedcbcb24c5f8b4286aea62/R/stats.R#L177-L182
stats::density()
runs out of memory with very large datasets, but functions in theKernSmooth
package seem like a good alternative—they are fast, accurate, and work with very large datasets. See more here: https://vita.had.co.nz/papers/density-estimation.pdf