isfield: Checks if a list contains a field

View source: R/isfield.R

isfieldR Documentation

Checks if a list contains a field

Description

This function tries to replicate the behavior of the isfield function in Matlab

Usage

isfield(x, field)

Arguments

x

list

field

name of field

Value

A logical vector determining if field is within names(x)

References

https://se.mathworks.com/help/matlab/ref/isfield.html

Examples

S <- list(
  x = rnorm(100),
  title = "x"
)
isfield(S, "title")
isfield(S, "z")

matlab2r documentation built on Feb. 16, 2023, 10:39 p.m.

Related to isfield in matlab2r...