paste2: Concatenate Strings

View source: R/helpers.R

paste2R Documentation

Concatenate Strings

Description

Extends paste with the ability to remove missing values (NA).

Usage

paste2(..., sep = " ", collapse = NULL, na.rm = FALSE)

Arguments

...

Objects converted to character vectors.

sep

Character string to seperate the terms.

collapse

Character string to separate the results.

na.rm

Whether NA values should be skipped.

Source

http://stackoverflow.com/a/31508774

Examples

paste2(c("hello", "goodbye"), NA, NA, "world", NA)
paste2(c("hello", "goodbye"), NA, NA, "world", NA, na.rm = TRUE)

columbia-glacier/cgr documentation built on Jan. 17, 2024, 2:42 p.m.