gen_text: Generate label and bullet points

Description Usage Arguments Value Examples

View source: R/gen_text.R

Description

This function use the data to generate label and bullet points for the box.

Usage

1
2
3
gen_text(x, label = NULL, bullet = FALSE)

box_text(x, label = NULL, bullet = FALSE)

Arguments

x

A list or a vector to be used.

label

A character string as a label at the beginning of the text label. The count for each categories will be returned if no label is provided.

bullet

If shows bullet points. If the value is 'TRUE', the bullet points will be tabulated, default is 'FALSE'.

Value

A character string of vector.

Examples

1
2
3
4
5
6
7
8
9
val <- data.frame(
  am = factor(ifelse(mtcars$am == 1, "Automatic", "Manual")),
  car = row.names(mtcars)
)

gen_text(val$car, label = "Cars in the data")
gen_text(val$car, label = "Cars in the data", bullet = FALSE)
gen_text(split(val$car, val$am), label = "Cars in the data")
gen_text(split(val$car, val$am), label = "Cars in the data", bullet = FALSE)

consort documentation built on Dec. 21, 2021, 1:06 a.m.