First and foremost, dplyr improves, what all ready seemed magic. A lot of appreciation is definitely due.
A simple example:
# ``````````````````````````````````````````````````````````````````
customer = 1:3
profit = c(10,40,20)
df.1 = data.frame(cus = customer, pro = profit)
df.2 = df.1 %.%
mutate (cum.p = cumsum(pro),
per.t.pro = round(cum.p / sum(cum.p),2))
# ``````````````````````````````````````````````````````````````````
gives:
cus pro cum.p
per.t.pro1 10 10 0.08
2 40 50 0.38
3 20 70 0.54
Question:
Is it possible to have grand totals at the bottom , or at the right most.
For e.g. a row at the bottom giving all the totals, something as follows:
cus pro cum.p
per.t.pro 1 10 10 0.08
2 40 50 0.38
3 20 70 0.54
70 70 1.00
// Cheers