Replacements in list
listBatchReplace
replaces in list lst
all entries with value searchValue
by replaceBy
listBatchReplace( lst, searchValue, replaceBy, silent = FALSE, debug = FALSE, callFrom = NULL )
lst
: input-list to be used for replacingsearchValue
: (character, length=1)replaceBy
: (character, length=1)silent
: (logical) suppress messagesdebug
: (logical) additional messages for debuggingcallFrom
: (character) allow easier tracking of messages producedThis function returns a corrected list
lst1 <- list(aa=1:4, bb=c("abc","efg","abhh","effge"), cc=c("abdc","efg")) listBatchReplace(lst1, search="efg", repl="EFG", sil=FALSE)
basic replacement sub
in grep
Useful links