## The function is currently defined as
function (x, beta)
{
res <- 0
for(bi in rev(beta))
res <- res*x + bi
res
}
beta <- c(1,2,1)
x <- 0:10
evalPol(x, beta)
str(evalPol(x, beta))
x <- cbind(0:10, 10:0)
evalPol(x, beta)
str(evalPol(x, beta))
x <- data.frame(x=0:10, y=10:0)
evalPol(x, beta)
str(evalPol(x, beta))Run the code above in your browser using DataLab