has: An R alternative to the lodash 'has' in JavaScript

View source: R/retrieve_and_has.R

hasR Documentation

An R alternative to the lodash has in JavaScript

Description

This is a handy function for checking if item exist in a nested structure

Usage

has(sourceList, path)

Arguments

sourceList

The list()/c() that is to be searched for the element

path

A string that can be separated by [,] or ., the string "elementname1.1.elementname" the validity of the path - it only separates and tries to address that element with '[[]]'.

Value

Returns a boolean.

See Also

Other lodash similar functions: retrieve()

Examples

has(list(a = list(b = 1)), "a.b")


Gmisc documentation built on Aug. 26, 2023, 1:07 a.m.