I am trying to plot a group bar chart in R. As of now I am using the package highcharter
but if this can be done in any other library that would be fine. This is what I am trying to get to :
spend_opt_tv <-tibble::tribble(
~Channel, ~Network, ~Daypart, ~Lower, ~Current, ~Upper, ~Optimized.Budget, ~CPM,
"TV 1", "NBC", "Other", "$13,790.50", "$27,581", "$41,371.50", "$41,372", "$4,555.00",
"TV 2", "NBC", "Weekday Afternoon", "$97,680.00", "$195,360", "$293,040.00", "$237,904", "$3,964.00",
"TV 3", "NBC", "Weekday Early Fringe", "$160,129.50", "$320,259", "$480,388.50", "$160,132", "$4,190.00",
"TV 4", "NBC", "Weekday Late Fringe", "$110,546.00", "$221,092", "$331,638.00", "$185,136", "$4,491.00",
"TV 5", "NBC", "Weekday Morning", "$226,253.00", "$452,506", "$678,759.00", "$354,960", "$6,206.00",
"TV 6", "NBC", "Weekends", "$35,880.00", "$71,760", "$107,640.00", "$107,640", "$4,147.00",
"TV 7", "CBS", "Other", "$95,873.50", "$191,747", "$287,620.50", "$238,774", "$5,145.00",
"TV 8", "CBS", "Prime Time", "$57,645.00", "$115,290", "$172,935.00", "$57,647", "$3,951.00",
"TV 9", "CBS", "Weekends", "$18,915.00", "$37,830", "$56,745.00", "$56,747", "$3,531.00"
)
network_grouped <- spend_opt_tv %>%
group_by(name = Network) %>%
do(categories = .$Daypart) %>%
list_parse()
highchart() %>%
hc_xAxis(categories = network_grouped) %>%
hc_add_series(data = spend_opt_tv, type = "bar" , hcaes(y = Current, color = Daypart),
showInLegend = FALSE)