Collapse a character vector into a single value, and replace newlines with spaces (and replace double spaces with single spaces).

zapNewlines(x)

Arguments

x

The character value or vector

Value

The resulting character vector

Examples

metabefor::zapNewlines(
  "So here we start,
and here we end"
);
#> [1] "So here we start, and here we end"