r - Create a stacked area plot in ggplot with Strings as X variables -
i'm trying create stacked bar chart, values come out lines. not sure how if "x" variable non-numeric.
reproducible example:
data <- read.table(text = "index country variable value 1 columbia cm 0.6530000 2 tanzania cm 0.7850164 3 columbia cc 0.3970000 4 tanzania cc 0.7752160 5 columbia ci 0.7170000 6 tanzania ci 0.6175699 7 columbia ca 0.8180000 8 tanzania ca 0.9167924") ggplot(data, aes(x=factor(country),y=value)) + geom_area(aes(color = variable, fill = variable)) looks this:

Comments
Post a Comment