Check for missing arguments using function call and a provided vector with argument names to check
Usage
arg.check(
call,
arguments = c("LR", "inv.R", "branch.length", "n.descen", "tree")
)
Examples
# \donttest{
geop <- function(x, tree, ...){
f4 <- arg.check(match.call(),
c("LR", "inv.R",
"branch.length", "n.descen"))
f1 <- arg.check(match.call(),
c("tree"))
c(f1, f4)
}
geop(1, 1)
#> Error in get(sub("phyloraster::|phyloraster::", "", as.character(as.list(call)[[1]]))[1], mode = "function", envir = loadNamespace("phyloraster")): object 'geop' of mode 'function' was not found
geop(1)
#> Error in get(sub("phyloraster::|phyloraster::", "", as.character(as.list(call)[[1]]))[1], mode = "function", envir = loadNamespace("phyloraster")): object 'geop' of mode 'function' was not found
geop(1, LR=1)
#> Error in get(sub("phyloraster::|phyloraster::", "", as.character(as.list(call)[[1]]))[1], mode = "function", envir = loadNamespace("phyloraster")): object 'geop' of mode 'function' was not found
# }