I have a data frame that contains three categorical variables that I tabulated using the following code:
df = data_frame(merged$arrears, merged$mortgage_type, merged$occupancy)
apply(df, 2, table)
And it gave me the following list:
## $`merged$arrears`
##
## 0 1 2 3 4
## 52124 5523 2371 1538 27
##
## $`merged$mortgage_type`
##
## bullet erm linear
## 19958 17326 18181
##
## $`merged$occupancy`
##
## btl holiday home owner occupied
## 12296 27996 13112
How can I add the percentage of each category to the count in the tables of the list?