Skip to contents

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")
#> title 
#>  TRUE 
isfield(S, "z")
#>     z 
#> FALSE