If I have a function with argument (...) and want to check if a variable is defined in the argument. How can I do this? I have already looked at the solution provided at this link: How to check if object (variable) is defined in R?. However, it does not solve my problem.
# Scenario 1
exists("a")
# [1] FALSE
# Scenario 2
a <- 10
exists("a")
# [1] TRUE
# Define a function for remaining scenarios
f = function(...){exists("a", inherits = F)}
# Scenario 3
f()
# [1] FALSE
# Scenario 4
a <- 10
f()
# [1] FALSE
# Scenario 5
a <- 10
f(a = 5)
# [1] FALSE
I want the answer to be TRUE
in Scenario 5.