listBatchReplace function

Replacements in list

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 )

Arguments

  • lst: input-list to be used for replacing
  • searchValue: (character, length=1)
  • replaceBy: (character, length=1)
  • silent: (logical) suppress messages
  • debug: (logical) additional messages for debugging
  • callFrom: (character) allow easier tracking of messages produced

Returns

This function returns a corrected list

Examples

lst1 <- list(aa=1:4, bb=c("abc","efg","abhh","effge"), cc=c("abdc","efg")) listBatchReplace(lst1, search="efg", repl="EFG", sil=FALSE)

See Also

basic replacement sub in grep

  • Maintainer: Wolfgang Raffelsberger
  • License: GPL-3
  • Last published: 2024-08-20

Useful links