I want to solve and graph a differential equation for exponential growth but I can't quite understand how to use the deSolve library. My equation is N = N_0 * e^(rt) and the code that I tried is
library(deSolve)
## Time
t <- seq(0, 5, 1)
## Initial population
N0 <- 2
## Parameter values
r = 1
fn <- function(t, N0, r) with(r, list(N0 * exp(r*t)))
## Solving and ploting
out <- ode(N0, t, fn, params)
plot(out, lwd=2, main="exp")
but the output that I hope is not what I want. The graphs that I want to obtain are the following:
I hope you can help me. Thank you

