collapse_comments {tidyplus}R Documentation

Collapse Comments

Description

Collapse comments coercing each element to a string (character scalar) and then collapsing into a single string using the '. ' separator.

Usage

collapse_comments(...)

Arguments

...

objects to be collapsed into a string.

Value

A string of the collapsed comments.

See Also

unite_str()

Examples

collapse_comments("Saw fish", character(0), "Nice. .", NA_character_)

data <- data.frame(
  visit = c(1,1,2, 2), 
  fish = 1:4,
  comment = c("Sunny day.  ", "Skinny fish", "Lost boot", NA))

## Not run: 
data |>
  dplyr::group_by(visit) |>
  dplyr::summarise(comment = collapse_comments(comment)) |>
  dplyr::ungroup()

## End(Not run)

[Package tidyplus version 0.0.2 Index]