Learn R Programming

tidytable (version 0.5.8)

count.: Count observations by group

Description

Returns row counts of the dataset. If bare column names are provided, count.() returns counts by group.

Usage

count.(.df, ...)

Arguments

.df

A data.frame or data.table

...

Columns to group by. tidyselect compatible.

Examples

Run this code
# NOT RUN {
test_df <- data.table(
  x = 1:3,
  y = 4:6,
  z = c("a", "a", "b"))

test_df %>%
  count.()

test_df %>%
  count.(z)

test_df %>%
  count.(where(is.character))
# }

Run the code above in your browser using DataLab