Hi I have a a following spark dataframe. I want to sum across rows. I couldn't find any equivalent function of row sum in sparklyr. I tried the following query but it sums the column values.
trans1M_20 %>%
dplyr::select(trans1M_20_clicks) %>%
dplyr::select(Small_SubChannel_Clicks_names) %>%
dplyr::summarise_each(funs(sum))
Note that Alma_1 is the Small_Subchannel_Clicks_names.
Alma_1
<dbl>
0
0
0
0
0
0
0
0
0
0
I am trying to aggregate multiple columns into one single column and summing the rows. Small_SubChannel_Clicks_names
can contain n number of column names. I want to do something like:
rowSums(trans1M_20[, Small_SubChannel_Clicks_names,drop=F]) –