Hi. I want to create a function whose arguments are formulas.
plotz <- function(y,z){
x<- seq(from=-5, to=5, by=.001)
plot(x,y, col="red")
points(x,z, col="blue")
}
f <- exp(x)
g <- exp(x^2)
plotz(f, g)
Not only does this not work, but I get error message that x is not found, presumably at f <- exp(x). How do I fix this? Thank you.
Error: object 'x' not found
Execution halted