my_iface = iface(
col1 = integer + group_unique ~ "an integer column",
.default = tibble::tibble(col1 = 1:3)
)
x = function(df = my_iface, ...) {
if(imissing(df)) {
message("missing parameter")
} else {
message("parameter given")
}
df = ivalidate(df)
return(df)
}
x() # missing parameter message, and function returns default value
try(x(iris)) # parameter given message but input will not validate
Run the code above in your browser using DataLab