missing can be used to test whether a value was specified as an argument to a function.
missing(x)
| Parameter | Description |
|---|---|
x |
a formal argument. |
# NOT RUN {
myplot <- function(x, y) {
if(missing(y)) {
y <- x
x <- 1:length(y)
}
plot(x, y)
}
# }