Pivot a Spark DataFrame
Construct a pivot table over a Spark Dataframe, using a syntax similar to
sdf_pivot(x, formula, fun.aggregate = "count")
A two-sided R formula of the form
How should the grouped dataset be aggregated? Can be a length-one character vector, giving the name of a Spark aggregation function to be called; a named R list mapping column names to an aggregation method, or an R function that is invoked on the grouped dataset.