stacked barplot

Hi,

I want to draw a stacked barplot consisting of two variables
var1 - interest_expense
var2 - NI_expense.
I want to make a stacked barplot for each bank for a duration of 5 years. I am unable to plot it.

Thanks in advance.

data

bank Mar-20 Mar-19 Mar-18 Mar-17 Mar-16 Mar-20 Mar-19 Mar-18 Mar-17 Mar-16
item interest_expense interest_expense interest_expense interest_expense interest_expense NI_expense NI_expense NI_expense NI_expense NI_expense
Bank of Baroda 48532.37 31290.3 28126.77 28686.52 31321.43 37222.42 24341.28 24610.74 18888.33 23134.25
Bank Of India 27096.29 27110.14 27565.07 27464.74 30071.84 24926.94 24336.58 22283.8 20156.76 21466.38
Bank of Maharashtra 7216.65 7116.12 7706.68 8887.27 9174.29 5539.44 10064.81 6041.43 6055.27 4797.3
Canara Bank 35811.08 32332.22 29088.76 31515.87 34258.77 23172.78 20706.06 23328.42 16304.25 17451.42
Central Bank of India 15933.62 15866.39 17518.51 18087.4 18822.27 12387.02 14826.6 14244.26 11888.75 10122.08
Indian Bank 13798.55 12166.72 10850.09 10893.69 11797.6 10165.53 8579.03 7410.4 5951.75 5516.22
Indian Overseas Bank 12103.28 12352.13 12447.64 14529.02 18134.6 17189.91 13223.33 15513.51 11978.95 10808.28
Punjab National Bank 36362.24 34153.94 33073.36 32282.82 32112.57 26375.73 34509.21 36086.1 22619.74 26163.2
State Bank of India 159238.77 154519.78 145645.6 113658.5 106803.49 128818.19 124261.53 126001.86 86836.57 75089.52
UCO Bank 10042.06 10019.48 10895.4 12509.02 13712.95 10400.32 10145.75 8682.1 7781.94 9243.59
Union Bank of India 25794.37 23851.75 23443.34 23756.64 23885.7 19595.32 17636.3 19541.9 13312.73 10593.23

What have you tried so far? It would be helpful to format your data in a way that's easier for others to import into their R environment. See:

Using either dparse or dput makes for data that can be conveniently copy pasted into an R console.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.