str_paste: Equivalent to base paste but with an extra na.rm parameter

Description Usage Arguments Value Examples

View source: R/str.R

Description

Found on : http://stackoverflow.com/questions/13673894/suppress-nas-in-paste

Usage

1
str_paste(..., sep = " ", collapse = NULL, na.rm = TRUE)

Arguments

...

one or more R objects, to be converted to character vectors.

sep

a character string to separate the terms.

collapse

an optional character string to separate the results.

na.rm

logical. Should missing values (including NaN) be removed?

Value

A character vector of the concatenated values.

Examples

1
2
paste("chaine1", NA_character_, "chaine2")
caractr::str_paste("chaine1", NA_character_, "chaine2")

stephLH/caractr documentation built on May 13, 2020, 1:53 p.m.