cocopig331 发表于 2016-2-6 05:37 
I'm not sure whether this is what you want
a = c(1:10)
好像不对啊,为什么分母是 sum(a) 呢?
What if the data is like this:
a <- data.frame(sample(1:100,20),rnorm(20),rnorm(20))
How could you get the cumulative percent for each variable in the data frame?