Fractional y-var in ggplot

Posted by Misha on Stack Overflow See other posts from Stack Overflow or by Misha
Published on 2010-05-26T13:03:34Z Indexed on 2010/05/26 15:01 UTC
Read the original article Hit count: 165

Filed under:
|

How can I easily create a fractional y-value when using ggplot?

t <- as.factor(test=sample(seq(0,100,10),1000,rep=T))
d <- as.factor(sample(c(0,1),1000,rep=T)
p <- data.frame(t,d)

My best shot was:

ggplot(p,aes(x=t,y=prop.table(table(t,d),1)[,1])) + geom_point()

However this doesnt work and I guess there is an easier way around this...

© Stack Overflow or respective owner

Related posts about r

    Related posts about graph