squish_newlines {unheadr}R Documentation

Deduplicate and remove trailing line breaks

Description

Deduplicate and remove trailing line breaks

Usage

squish_newlines(sepstring)

Arguments

sepstring

A character vector with new line control characters.

Details

Useful for tables with merged cells, often imported from Word or PDF files. Can be applied across multiple columns before separating into rows.

Value

A vector without trailing or multiple consecutive new line sequences.

Examples

vecWithNewlines <- c("dog\n\ncat\n\n\npig\n")
squish_newlines(vecWithNewlines)


[Package unheadr version 0.4.0 Index]