Hi,

I am using a loop for generate data to be used in some plots, but the function computes results from 5 repetitions.

When a tried to insert the graphs in a list, only one graph from the last repetition is saved, because the list index is different from the loop index.

Is there a way to use an empty list without especify the index? (like function append for example)

To simplify, here is a pseudocode:

graphs_list <- list()

for(i in 1:4){

data_i <- data[[i]]

for(j in 1:5) {

predict_ANN_ij <- compute(ANN, rep = j)

plot_base <- tibble(observed, predict_ANN_ij)

graph <- ggplot(plot_base)

graphs_list[[...]] <- graph

}

}

The code is runnig right.

All graphs are printted correctly, but I need to store them inside an object to further use.

Can someone help me please!!