Added isfield translation function
This commit is contained in:
parent
62598eaf0d
commit
317d281e70
2 changed files with 29 additions and 0 deletions
9
R/isfield.R
Normal file
9
R/isfield.R
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#' @title Checks if a list contains a field
|
||||
#' @description This function tries to replicate the behavior of the `isfield`
|
||||
#' function in Matlab
|
||||
#' @param x list
|
||||
#' @param field name of field
|
||||
#' @references https://se.mathworks.com/help/matlab/ref/isfield.html
|
||||
isfield <- function(x, field) {
|
||||
field %in% names(x)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue