Filter a list to match the formal arguments of a target function
filter_function_args.RdRemoves elements from a list that are not formal arguments of a specified function. Optionally emits a warning for discarded elements.
Examples
control <- list(ntree = 100, bogus = 1)
clean_args <- filter_function_args(control, missForest::missForest)
#> Warning: The following arguments are not accepted by missForest::missForest and were ignored: bogus
# bogus is removed