I want to take user input, call a function using that input, then print the actual arguments to the screen.
fitfun <- function(dataset = Auto, outcome = 1, predictor = 3) {
fits <- lm(dataset[,outcome] ~ dataset[,predictor])
summary.lm(fits)$call
}
The output of this code is:
> fitfun()
lm(formula = dataset[, outcome] ~ dataset[, predictor])
What I want is:
> fitfun()
lm(formula = Auto[, 1] ~ Auto[, 3])