list_remove: Remove (Named) Elements from a List.

Description Usage Arguments Examples

View source: R/list_remove.R

Description

Jettison names or indices of a list and retain everything else (including names).

Usage

1
list_remove(mylist, element)

Arguments

mylist

A list object that has superfluous elements.

element

A vector (either character or numeric) of elements to drop from 'mylist'.

Examples

1
2
3
4
5
6
7
testlist <- list('first' = c(1:3), 'second' = 2, 'third' = c(4:9), 'last' = 'hello')
list_remove(mylist = testlist, element = c('first', 'third'))
$second
[1] 2

$last
[1] "hello"

danjamesadams/Dantools documentation built on Aug. 24, 2019, 6:15 p.m.