str_or_na_replace: Replaces string or NA in a character vector with either NA or...

View source: R/str_or_na_replace.R

str_or_na_replaceR Documentation

Replaces string or NA in a character vector with either NA or another string.

Description

This is to augment stri_replace_all_fixed(), which does not allow NA as a pattern.

Usage

str_or_na_replace(x, pattern, replacement, fold = FALSE)

Arguments

x

character vector

pattern

string pattern to search for may be empty string or NA. Comparison is done with "==". Case can be ignored.

replacement

string to replace entire entity that has pattern.

fold

logical value where if TRUE the vector x and pattern are converted to lower case.


rmsharp/rmsutilityr documentation built on Feb. 13, 2024, 6:01 p.m.