bstr_replace: Replace matched patterns in bstr sequences by replacements

Description Usage Arguments Examples

View source: R/bstr_replace.R

Description

Replace matched patterns in bstr sequences by replacements

Usage

1
bstr_replace(bstrobj, pattern, replacement, case_sensitive = FALSE)

Arguments

bstrobj

bstr class object or character vector

pattern

Pattern to look for.

replacement

A character vector of replacements or a function.

case_sensitive

sensitive to case in pattern (default:FALSE)

Examples

1
2
3
4
5
bstr_replace("AtGcTaat", "at", "cc")
bstr_replace("AtGcTaat", "at", c("cc", "xx"))
bstr_replace("AtGcTaat", c("at", "gc"), c("cc", "xx"))
bstr_replace("AtGcTaat", c("at", "gc"), c("cc", "xx"), TRUE)
bstr_replace("AtGcTaat", c("at", "gc"), bstr_switch_case)

t-arae/bstringr documentation built on March 18, 2021, 3:08 a.m.