Skip to content

Commit

Permalink
Collapsing of vectors to strings allow more items
Browse files Browse the repository at this point in the history
  • Loading branch information
sda030 committed Dec 11, 2024
1 parent 388ce71 commit e2b47f2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/collapse_chapter_structure_to_chr.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
collapse_chapter_structure_to_chr <- function(data, sep=",", sep2=",", last=",", trunc = 30) {
collapse_chapter_structure_to_chr <- function(data, sep = ",", sep2 = ",", last = ",", trunc = 35) {
data |>
dplyr::distinct(dplyr::pick(tidyselect::everything())) |>
lapply(FUN = function(col) {
col <- as.character(col)
uniques <- unique(col)
uniques <- uniques[!is.na(uniques)]
cli::ansi_collapse(uniques, sep=sep, sep2 = sep2, last = last, trunc = trunc, width = Inf)
}) |>
lapply(FUN = function(col) {
col <- as.character(col)
uniques <- unique(col)
uniques <- uniques[!is.na(uniques)]
cli::ansi_collapse(uniques, sep = sep, sep2 = sep2, last = last, trunc = trunc, width = Inf)
}) |>
unlist()
}

0 comments on commit e2b47f2

Please sign in to comment.