I'm trying to do a density plot of two datasets (of different size) 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 nice plot showing that the smaller dataset has higher values but I also get a warning message saying:
Warning message: Removed 35492 rows containing non-finite values
(stat_density).
Can someone explain why and how to get rid of that?