I am would like to produce a figure that was two y-axes labels on either side of the plot. These aren't different y-axes and I won't be drawing multiple sets of data on one figure by making use of two axes. I am aware of the pitfalls of this. Rather, I would like to print a label on the right side of the plot simply as a secondary label - an additional piece of information. In the example below I have the label of the left side (y) and i would like to use the values from y2 to label the other side. The y and y2 values represent the same thing and thus should be aligned accordingly. Is this possible in ggplot2?
Thanks in advance.
library(ggplot2)
x <-runif(80, 0,100)
data <- as.data.frame(x)
data$y <-1:4
data$y2 <- factor(c("One","Two","Three","Four"))
data$z <- factor(c("A","B","C","D","E"))
a <- ggplot(data, aes(x = y, y = x, fill = z))
b <- a + geom_bar(stat = "identity", position = "stack") + coord_flip()
b
--
*****************************************************
Sam Albers
Geography Program
University of Northern British Columbia
3333 University Way
Prince George, British Columbia
Canada, V2N 4Z9
phone:
250 960-6777*****************************************************