I have a data frame that looks like the following:
threshold <- c("thresh1","thresh3","thresh10","thresh3","thresh3", "thresh10")
expression <- c("expressed", "expressed", "expressed", "depleted", "expressed", "depleted")
data.frame("Threshold" = threshold, "Expression" = expression)
I would like to generate a histogram of counts of the different thresholds, bucketed by the expression.
I have attempted to do so using geom_bar()
, but I not want the data stacked. Rather, I want the different categories (depleted, enriched etc...) to be represented in their own bars.
ggplot(final_nonexpressed, aes(x = threshold, fill = expression))+geom_bar(width = 0.5)
Any help would be appreciated!