I want to plot the percentage distribution of four different habitat types of male bats during morning trips using ggplot.
My code is the following:
ggplot(subset(random_df_morn[which(random_df_morn$Sex =="male"),]), aes(x = daytime, fill=biotop_new, stat="bin"), main="morning")+ geom_histogram()
But on the y-axis appears "count" instead of "percentage".
What i added was:
+ geom_bar(aes(y = (..count..)/sum(..count..))) + scale_y_continuous(labels=percent)
But as the "count" was 600, now the percentage is also limited at 60%. But what I need or my purpose are the distributions on a 100% scale.
How can I set the y-axis to 100% instead of the 60%?.
Thank you very much for any help.