Added vectorizing capability and unit test

This commit is contained in:
Waldir Leoncio 2020-03-03 11:04:40 +01:00
parent 317d281e70
commit 2f6ad882a9
2 changed files with 14 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#' @param x list
#' @param field name of field
#' @references https://se.mathworks.com/help/matlab/ref/isfield.html
#' @export
isfield <- function(x, field) {
field %in% names(x)
sapply(field, function(f) f %in% names(x))
}