I am trying to get my function (in r) to work with a two-element vector as an argument, but when I run the function with inputs, one of the elements is "not found".
I've tried using a placeholder as the argument and defining the placeholder later in the function. I've also tried to use concatenated values directly as the argument.
mse.func <- function(ya.vctr, N=gmp$pop, Y=gmp$pcgmp){
ya.vctr <- c(y, a)
mean.sq.er <- mean((Y - (y * (N^a)))^2)
return(mean.sq.er)
}
mse.func(c(5000, 0.10))
I'm expecting a numerical value but mse.func(c(5000, 0.10)) returns an error stating that "object 'y' is not found".