I was following this https://stackoverflow.com/a/3542115/3483997 approach in order to get 2 histograms (with different populations) integrated in the same data-frame.
ROS_SPITFIRE <- data.frame(length = rnorm(100, 0.76406353, 0.500970292))
ROS_FARSITE <- data.frame(length = rnorm(398, 3.48366834170854,2.19050069588744))
#Now, combine your two dataframes into one. First make a new column in each.
ROS_SPITFIRE$veg <- 'ROS_SPITFIRE'
ROS_FARSITE$veg <- 'ROS_FARSITE'
#and combine into your new data frame vegLengths
vegLengths <- rbind(ROS_SPITFIRE, ROS_FARSITE)
#now make your lovely plot
ggplot(vegLengths, aes(length, fill = veg)) + geom_density(alpha = 0.3)
ggplot(vegLengths, aes(length, fill = veg)) + geom_density(alpha = 0.3)
ggplot(vegLengths, aes(length, fill = veg)) + geom_histogram(alpha = 0.5, aes(y = ..density..), position = 'identity')
ggplot = ggplot + xlim((0,15))
My problem popped up when I´ve created the new column in each data-frame. It generates negative values, hence my final distribution plots have negative values on the X-axes. Does anyone know how to fix it?
Thx