txt_pct_fr: Summary text functions for html tables

View source: R/txt_pct_fr.R

txt_pct_frR Documentation

Summary text functions for html tables

Description

Summary text functions for html tables

Usage

txt_pct_fr(var, referent_value, na.rm = TRUE)

Arguments

var

A vector, or variable name within a dataframe

referent_value

A character string to define the reference value

na.rm

a logical value indicating whether NA values should be stripped

Examples

library(dplyr)
txt_pct_fr(mtcars$gear, 4)
mtcars %>%
  group_by(cyl) %>%
  summarise(pct_4gears = txt_pct_fr(gear, 4)) # shows what percentage have 4 gears (selected reference) and (with fraction)

JMLuther/tabletools documentation built on July 1, 2024, 2:01 p.m.