fix_tibble_lists: Convert List Columns of a Tibble to String Vectors

View source: R/CodeAndRoll2.R

fix_tibble_listsR Documentation

Convert List Columns of a Tibble to String Vectors

Description

Converts columns of type list in a tibble or data frame to string vectors. It combines list elements into a single string per cell, using a specified separator.

Usage

fix_tibble_lists(df, verbose = TRUE, print_full = FALSE, collapse_by = ",")

Arguments

df

A tibble or data frame where list columns are to be converted. Default: None, must be supplied by the user.

verbose

Logical; whether to print progress messages. Default: TRUE.

print_full

Logical; whether to print full details. Default: FALSE.

collapse_by

The character used to collapse list elements. Default: ",".

Value

A tibble or data frame with list columns converted to string vectors.

Examples

df <- tibble::tibble(a = list(1:2, 3:4, 5:6), b = c("A", "B", "C"))
fix_tibble_lists(df)


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.