Value counts
Description
Count all unique values and create a struct mapping value to count.
Usage
<Expr>$value_counts(..., sort = FALSE, parallel = FALSE, name = "count")
Arguments
…
|
Ignored. |
sort
|
Ensure the output is sorted from most values to least. |
parallel
|
Better to turn this off in the aggregation context, as it can lead to contention. |
name
|
Give the resulting count field a specific name, defaults to
“count” .
|
Value
Expr
Examples
#> shape: (3, 1)
#> ┌───────────────────┐
#> │ Species │
#> │ --- │
#> │ struct[2] │
#> ╞═══════════════════╡
#> │ {"virginica",50} │
#> │ {"versicolor",50} │
#> │ {"setosa",50} │
#> └───────────────────┘
#> Species count
#> 1 virginica 50
#> 2 versicolor 50
#> 3 setosa 50