Displaying 1 result from an estimated 1 matches for "dftest2".
Did you mean:
dftest
2012 May 04
1
Absolute cumulative curve with ecdf/stepfun?
...ad of relative. Can that be done with ecdf or with stepfun()
to get values I can use to plot the curves?
Here a small example that shows the result with ecdf:
library(ggplot2)
library(reshape)
dftest1 <- data.frame(value=runif(1000,0,1),variable=rep(c("a","b"),c(500,500)))
dftest2 <- ddply(dftest1,.(variable),transform, ecd = ecdf(value)(value))
ggplot(dftest2,aes(x = value, y = ecd)) +
geom_line(aes(group = variable,colour = variable))
I'd like to replace the ecdf-function in ddply with a function that gives cumulative counts resp. the cumulative position of eac...