View source: R/collapse-comments.R
collapse_comments | R Documentation |
Collapse comments coercing each element to a string (character scalar) and then collapsing into a single string using the '. ' separator.
collapse_comments(...)
... |
objects to be collapsed into a string. |
A string of the collapsed comments.
unite_str()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.