tags:

views:

45

answers:

0

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...