I am trying to create a beanplot:
library(beanplot)
beanplot(df, col="#cccccc", log="y", names="plot-1", yaxt="n", overallline="median", ll=0.00001)
However, I get the following error:
Error in density.default(mlog(x), bw = bw, kernel = kernel, from = from, :
non-finite 'from'
Can anyone please help?
It's impossible to be sure without seeing your data, but I suspect that your problem comes from having one or more zeros in the input then trying to draw its density on a log scale.
I can replicate your problem like this:
If we remove the zeros, we get a plot:
Or we can remove the log scale and keep the zeros:
But clearly we can't both keep the zeros and have a log scale, since the log of zero is interpreted as negative infinity in R.