powered by
Count the number of rows for each group when we have GroupedData input. The resulting SparkDataFrame will also contain the grouping columns.
GroupedData
This can be used as a column aggregate function with Column as input, and returns the number of items in a group.
Column
count(x)n(x)# S4 method for GroupedData count(x)# S4 method for Column count(x)# S4 method for Column n(x)
n(x)
# S4 method for GroupedData count(x)
# S4 method for Column count(x)
# S4 method for Column n(x)
a GroupedData or Column.
A SparkDataFrame.
Other agg_funcs: agg, avg, countDistinct, first, kurtosis, last, max, mean, min, sd, skewness, stddev_pop, stddev_samp, sumDistinct, sum, var_pop, var_samp, var
agg
avg
countDistinct
first
kurtosis
last
max
mean
min
sd
skewness
stddev_pop
stddev_samp
sumDistinct
sum
var_pop
var_samp
var
# NOT RUN { count(groupBy(df, "name")) # } # NOT RUN { count(df$c) # } # NOT RUN { n(df$c) # }
Run the code above in your browser using DataLab