# NOT RUN {
ftest <- function(x1, ...) c(hasArg(x1), hasArg("y2"))
ftest(1) ## c(TRUE, FALSE)
ftest(1, 2) ## c(TRUE, FALSE)
ftest(y2 = 2) ## c(FALSE, TRUE)
ftest(y = 2) ## c(FALSE, FALSE) (no partial matching)
ftest(y2 = 2, x = 1) ## c(TRUE, TRUE) partial match x1
# }
Run the code above in your browser using DataLab