removeFromList: Remove an entry from a list

View source: R/utilities.R

removeFromListR Documentation

Remove an entry from a list

Description

Removes all occurrences of the entry from the list. If the entry is not in the list nothing is removed.

Usage

removeFromList(entry, listArg)

Arguments

entry

The entry to be removed

listArg

The list from which the entry will be removed

Value

The list without the entry. If the input is a vector, it is converted to a list.

Examples

myList <- list("one", "two", "one", "three")
myList <- removeFromList("one", myList)
print(myList)

esqLABS/esqlabsR documentation built on April 17, 2025, 10:51 a.m.