I have some data like this:
myd <- structure(list(var1 = structure(1:4, .Label = c("II", "III",
"IV", "V"), class = "factor"), zero_co = c(15.15152, 3.030303,
0, 0), non_zero_CO = c(84.84848, 96.969697, 100, 100), size = c(230,
813, 317, 1532)), .Names = c("var1", "zero_co", "non_zero_CO",
"size"), row.names = c(NA, -4L), class = "data.frame")
# myd
# I II III IV V
# zero_co 15.15152 3.030303 0 0
# non-zero CO 84.84848 96.969697 100 100
# size 230.00000 813.000000 317 1532
I want to plot size
on the y-axis and other two variables zero_co
and non-zero CO
as a stacked bars on the x-axis. I am trying to plot this using gplots
and ggplots
but finding difficulties. How do I plot this?