add_list_column: Make a column into a list column

View source: R/tables.R

add_list_columnR Documentation

Make a column into a list column

Description

Make a column into a list column

Usage

add_list_column(
  data,
  ...,
  type = c("1", "a", "A", "I", "i"),
  sep = ". ",
  merge = FALSE
)

Arguments

data

data.frame or tibble

...

Column name or tidyselect function. Select columns. Default is first column

type

list type: "1" (default) for 1, 2, 3; "a" for a, b, c; "A" for A, B, C; "i" for i, ii, iii; or "I" for I, II, III

sep

text between the list label and the item (default: ". ", as in "1. ")

merge

If TRUE, list columns will be united with their respective text columns.

Value

data.frame

Examples

d <- data.frame(x = letters[1:5], y = letters[2:6])
# default is first column
add_list_column(d) |>
  apa_flextable()
# select any column
add_list_column(d, y) |>
  apa_flextable()
add_list_column(d, type = "a", sep = ") ") |>
 apa_flextable()
add_list_column(d, merge = TRUE)

apa7 documentation built on Dec. 1, 2026, 5:06 p.m.