New to R. Using dplyr, trying to group_by multiple variables, summarize by multiple variables, multiple functions.
This works as expected
mtcars %>%
+ group_by(cyl,hp) %>%
+ summarise(min_mpg = min(mpg) , min_disp = min(disp), max_mpg = max(mpg) , max_disp = max(disp))
But when I try to replicate with my df
vmp %>%
+ group_by(Priority,LOS) %>%
+ summarise(inv_total = sum(Inv_Total), sr_count = count(SR_Nmbr))
I receive this error:
Error in summarise_impl(.data, dots) : Evaluation error: no applicable method for 'groups' applied to an object of class "factor".
What am I doing wrong? Thx
We can use
type.convert
to convert the column types automatically