mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 17:42:10 +01:00
542 B
542 B
Substitue spaces/tabs with single space excluding text within quotes
Written assisted by Claude.ai. It is long and possibly too complicated, but it works
Usage
collapse_spaces(x, preserve_newlines = TRUE)
Arguments
-
x:
character string
-
preserve_newlines:
flag to preserve new lines
Value
character string
Examples
collapse_spaces(c("cyl", "di sp","s e d","d e'dl e'"))
#> Error in collapse_spaces(c("cyl", "di sp", "s e d", "d e'dl e'")): could not find function "collapse_spaces"