find_replace: Find and replace single or multiple values in a vector. Usage...

View source: R/find_replace.r

find_replaceR Documentation

Find and replace single or multiple values in a vector. Usage is similar to gsub except that this function will not replace parts of character strings

Description

Find and replace single or multiple values in a vector. Usage is similar to gsub except that this function will not replace parts of character strings

Usage

find_replace(pattern, replacement, x)

Arguments

pattern

vector of values to find

replacement

vector of values to replace

x

a character vector where matches are sought

Author(s)

Nikolai Klibansky

Examples

## Not run: 
# Find and replace names of multiple parameters
rdat <- rdat_BlackSeaBass
parms <- rdat$parms
parms_names <- names(parms)
parms_key <- c("R0"="BH.R0", "M.msst"="M.constant", "M.MSST"="M.constant")
find_replace(names(parms_key),parms_key,parms_names)

## End(Not run)

nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.