Learn R Programming

healthyR (version 0.1.4)

category_counts_tbl: Counts by Category

Description

Get the counts of a column by a particular grouping if supplied, otherwise just get counts of a colum

Usage

category_counts_tbl(.data, .count_col, .arrange_value = TRUE, ...)

Arguments

.data

The data.frame/tibble supplied

.count_col

The column that has the values you want to count

.arrange_value

Defaults to true, this will arrange the resulting tibble in descending order by .count_col

...

Place the values you want to pass in for grouping here

Details

  • Requires a data.frame/tibble

  • Requires a value column, a column that is going to counted

Examples

Run this code
# NOT RUN {
library(healthyR.data)
library(dplyr)

healthyR_data %>%
  category_counts_tbl(
    .count_col = payer_grouping
    , .arrange = TRUE
    , ip_op_flag
  )

healthyR_data %>%
  category_counts_tbl(
    .count_col = ip_op_flag
    , .arrange_value = TRUE
    , service_line
  )

# }

Run the code above in your browser using DataLab