I have a data frame with the names of articles, number of samples overall for each article, number of responders for a drug and number of non-responders. All together there are 9 articles:
Articles <- c("Nadeem Riaz", "David Braun","immotion150", "IMVIGOR210", "Alexander Lozano",
"Van Allen", "Alexandra Pender", "David Lui", "Jae Cho")
Samples_number <- c(49, 311, 247, 298, 47, 39, 82, 121, 16)
With_Benefit <- c(26, 89, 168, 131, 27, 13,17,65, 5)
No_Benefit <- c(13, 102, 79, 167, 20, 26, 65, 56, 11)
MyData <- data.frame(Articles, Samples_number, With_Benefit, No_Benefit)
I need to make a bar chart with the Articles Names on the x axis, the overall samples number on the y axis, and color each bin so that for example responders would be blue and non-responders red, for each article.
I built a bar chart I just don't know what to type in the fill segment: (here I just typed the No_Benefit column but I know it's a wrong fill)
myplot <- ggplot(MyData, aes(x = Articles, y = Samples_number, fill= No_Benefit)) + theme_bw() + geom_col(position = "stack")
print(myplot)