Skip to content

Commit

Permalink
correct empty check (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed May 10, 2024
1 parent 572880a commit a6e2a27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/list.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
#' @export
list0 <- function(...) {
e <- as.list(substitute(list(...)))[-1L]
do.call(list, e[e != substitute()], envir = parent.frame(2))
do.call(list, e[is_not_empty(e)], envir = parent.frame(2))
}

#' @export
#' @rdname list0
lst <- list0

is_not_empty <- function(x) {
x <- x != substitute()
x | is.na(x)
}

0 comments on commit a6e2a27

Please sign in to comment.