Roham
Roham

Reputation: 39

Table in Row. How to show each value as percentage of total row of the table

I'm trying to show each value in a percentage of its total row value.

ClientFeedbackQuant <- cut(MR_Data$ClientFeedbackScore, quantile(MR_Data$ClientFeedbackScore, c(0,.20,.4,.6,.8,1)) ,include.lowest = TRUE)

table1 <- table(MR_Data$Division , ClientFeedbackQuant)
table1
           [11,72] (72,84.2] (84.2,91] (91,97] (97,100]
  Atlanta       44         9         2       1        0
  Denver        22        56        24      20        9
  Mobile        61        36        31      14       38
  Portland       0        20        75      82       75

Upvotes: 1

Views: 240

Answers (1)

akrun
akrun

Reputation: 887118

One option is prop.table

prop.table(table1, 1)

Upvotes: 1

Related Questions