So, if one wishes to apply an operation row by row in dplyr, one can use the rowwise function, for example: Applying a function to every row of a table using dp
You can use as.data.frame(), like below
> data.frame(a=1:4) %>% rowwise() %>% group_by(a)
# A tibble: 4 x 1
# Groups: a [4]
a
*
1 1
2 2
3 3
4 4
Warning message:
Grouping rowwise data frame strips rowwise nature
> data.frame(a=1:4) %>% rowwise() %>% as.data.frame() %>% group_by(a)
# A tibble: 4 x 1
# Groups: a [4]
a
*
1 1
2 2
3 3
4 4