WFS_util_keep_unique: Keep first or last entry of list entries with duplicated...

View source: R/WFS_utils.R

WFS_util_keep_uniqueR Documentation

Keep first or last entry of list entries with duplicated names

Description

Keep first or last entry of list entries with duplicated names

Usage

WFS_util_keep_unique(mylist, keep_first = T, ignore.case = T)

Arguments

mylist

A named list

ignore.case

Logical scalar indicating if case is ignored when comparing for duplicate names

keep.first

Logical scalar indicating if the first (when TRUE) or last entry (when FALSE) with duplicate names will kept

Value

A copy of mylist with duplicate names removed (apart from the first when keep_first=TRUE or last otherwise )

Examples

L <- list( a = 1, A = 2, aA = 3, Aa = 4)
WFS_util_keep_unique(L,keep_first = T, ignore.case=T)
# list(a = 1, aA = 3)

HanOostdijk/HOQCwfs documentation built on March 6, 2023, 8:18 a.m.