Skip to content

Commit dd101c1

Browse files
committed
fix argument diff checking
1 parent 403f9ca commit dd101c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/check_args.r

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ check_args = function(fun, iter, const=list()) {
1212
# check function and arguments provided
1313
funargs = formals(fun)
1414
required = names(funargs)[unlist(lapply(funargs, function(f) class(f)=='name'))]
15+
required = setdiff(required, "...")
1516

1617
if (length(iter) == 1 && length(required) == 1 && is.null(names(iter)))
1718
names(iter) = required
1819

1920
provided = names(c(iter, const))
2021

2122
sdiff = unlist(setdiff(required, provided))
22-
if (length(sdiff) > 1 && sdiff != '...')
23+
if (length(sdiff) > 1)
2324
stop(paste("If more than one argument, all must be named:",
2425
paste(sdiff, collapse=" ")))
2526

0 commit comments

Comments
 (0)