Filter two level list by its secondary elements and remove empty items

filterListByElements(list, elements)

Arguments

list

A list.

elements

Character vector of elements to keep.

Value

List filtered according to elements argument.