I am trying to plot the density of two data sets (of different sizes) by writing:
data1 <- data.frame(dens = log2(c(tmm.th[,1],bidrar_mest[,1]))
, lines = c(rep("all",61893),rep("loaded",50) ))
ggplot(data1, aes(x = dens, fill = lines)) + geom_density(alpha = 0.5)
I get a good graph showing that a smaller dataset has higher values, but I also get a warning message:
Warning message: Removed 35492 rows containing non-finite values
(stat_density).
Can someone explain why and how to get rid of this?
source
share