powered by
This function removes elements from an indexable object (e.g., a named vector or list) where the names match a specified regular expression.
rmByName(x, pattern, silent = FALSE)
The input object with elements removed based on the name regex.
An indexable object (e.g., a named vector, list, or data frame).
A character containing a regular expression(s) to match the names of elements to be removed.
A logical indicating whether to silence a warning if no names are detected.
myList <- list(a = 1, b_test = 2, c = 3, d_test = 4) rmByName(myList, "_test")
Run the code above in your browser using DataLab