How can you plot a list of functions in one graph using a for loop in R? The following code does the trick, but requires a separate call of plot for the first function outside of the for loop, which is very clunky. Is there a way to handle all the plotting inside the for loop without creating multiple plots?
vec <- 1:10
funcs <- lapply(vec, function(base){function(exponent){base^exponent}})
x_vals <- seq(0, 10, length.out=100)
plot(x_vals, funcs[[1]](x_vals), type="l", ylim=c(0,100))
for (i in 2:length(vec)) {
lines(x_vals, funcs[[i]](x_vals))
}

ggplot, I just like keeping imports to a minimum, but only so much can be done. I think I just found a work-around, I'll post it as an answer below.