Re: [R] stacked plot

2011-10-21 Thread Henri-Paul Indiogine
Hi Dennis! Fantastic, great, wonderful, beautiful. I slightly changed your code to adapt it to my situation: ggplot(DF.2, aes(x=file.name, y=value, fill=codes))+geom_histogram(position="stack", stat="identity") + labs(x="document", y="number of codings") ### file.name codes

Re: [R] stacked plot

2011-10-21 Thread Dennis Murphy
It appears that your object is currently a matrix. Here's a toy example to illustrate how to get a stacked bar chart in ggplot2: library('ggplot2') m <- matrix(1:9, ncol = 3, dimnames = list(letters[1:3], LETTERS[1:3])) (d <- as.data.frame(as.table(m))) Var1 Var2 Freq 1aA1 2b

[R] stacked plot

2011-10-20 Thread Henri-Paul Indiogine
Hi! I am trying to use ggplot2 to create a stacked bar plot. Previously I tried using barplot() but gave up because of problems with the positioning of the legend and other appearance problems. I am now trying to learn ggplot2 and use it for all the plots that I need to create for my dissertati