I want to write a function, which calculates a linear regression based on the input.
I can build the function, but when I call it (e.g. myregression(i1,i2)
it will result in an error)
myregression <- function(input1, input2) {
model <- lm(data = trainData, example ~ input1 + input2)
}
How can I use the input in the function lm
?