Like in title i need to converte some data frame
data1 <- data.frame(Year = rep(c(2016, 2017, 2018, 2019), each = 12), Month = rep(month.abb, 4), Expenses = sample(50e3:100e3, 48))
Create a list year_y in which each year (element) contains a data frame with expenses in each month. Then using list year_y create a list containing for each year(element) the month with biggest expenses. Here is what the final result should look like:
$‘2016‘
[1] "Jul"
$‘2017‘
[1] "Nov"
$‘2018‘
[1] "May"
$‘2018‘
[1] "May"
And the thing is i need to use apply function family in both steps