I have some major problems with ggplot2. Even though it might be a very easy question to you I couldnt manage yet to get it right (I have read a ggplot2-book and was looking on stackoverflow as well).
Orginally there was a dataset consisting of a factor variable (country) and a dichotomous variable. Unfortunately I dont have my data in this extended format myself: I have two variables "var1" and "var2". var1 gives the number of cases in the original dataset where a certain condition is true and var2 gives the number of cases where the same condition is false:
country | var1 | var2
----------------------
"A" | 20 | 30
"B" | 24 | 53
"C" | 21 | 24
"D" | 30 | 66
Now I'd like to produce a stacked barplot with a y-axis showing percentages within each country (all bars should have the same height) plus the absolute numbers displayed within the bars:
I found out that if the data were in an extended format, I could use
ggplot(data=dataset)+geom_bar(aes(x=country, fill=variable), position='fill')
However, I only have aggregated data.
Could anyone please help me?
Thank you!


dput()makes it easier to help you. - Roman