Skip to contents

This function takes a vector of strings and flattens them into a single string.

Usage

d_flatten(x)

d_flatten_text(x)

Arguments

x

A character vector.

Value

A character vector where the elements are a single string.

Details

A wrapper for stringr::str_flatten(x, " ").

d_flatten() is fine for tagged text, but use d_flatten_text() when you want to remove floating spaces between a set of punctuation marks (.,;:!?") and tokens.

Functions

  • d_flatten: d_flatten

  • d_flatten_text: d_flatten_text

Examples

if (FALSE) {
x <- c("This" , "is" , "," , "or" , "at" , "least" , "should" , "be" , "," ,
"a" , "suitable" , "example" , "." , "Is" , "it", "?")
d_flatten(x)
d_flatten_text(x)}