Im plotting the logisticmap equation. I made a for loop to get the values and I want to plot all of them but it only plot the last iteration. Im new in R, is my first programming language. Thank you for help. :) Here is my code
n <- readline(prompt="Introduce el numero de iteraciones: ")
r <- readline(prompt="Introduce el parametro R: ")
xo <- readline(prompt="Introduce la condicion inicial x_o: ")
n <- as.numeric(n)
r <- as.numeric(r)
xo <- as.numeric(xo)
result <- 1:n
result[1] <- xo
for(i in 1:n){
result[i+1] = r*result[i]*(1-result[i])
print(result[[i+1]])
plot(i, result[i+1])
}