Hi,
I found this error "Must group by variables found in .data
. Column day
is not found. Shiny"
And this is my code
Montly/daily trend (server) -------------------------------------
output$group_totals <- renderD3({
grouped <- ifelse(input$month != 99, expr(day), expr(month))
res <- base_electric() %>%
group_by(month) %>%
summarise(sum_sales= sum(Amount)) %>%
group_by(sum_sales, !!grouped) %>%
tally() %>%
collect() %>%
mutate(
y = sum_sales,
x = !!grouped
) %>%
select(x, y)
if (input$month == 99) {
res <- res %>%
inner_join(
tibble(x = 1:12, label = substr(month.name, 1, 3)),
by = "x"
)
} else {
res <- res %>%
mutate(label = x)
}
r2d3(res, "col_plot.js")
})
Please help me. I am new in R
Thank you so much