I am trying to access output values inside the server on my shiny app. The values are inputed by the user in a loop: depending on the number 'n_matrizes', the user inputs 'n_matrizes' number of matrices. The server then collects all these matrices in a list, using lapply:
lapply(1:(n_matrizes()),function(i){
matrixInput(inputId = paste0("W_",i),
label = paste("Matriz espacial de ordem", i),
value = matrix(0,nrow=n_radares(),ncol=n_radares()))})
In the server, I need to access each of these matrices on the list. I've tried using reactive
and reactiveValues
but since I'm new to this programming, I haven't succeeded.
On normal R coding, I have done this before:
To create the list of matrices:
w_1 <- matrix(1,nrow=4,ncol=4)
w_2 <- matrix(2,nrow=4,ncol=4
w_3 <- matrix(3,nrow=4,ncol=4
W <- list(w_1,w_2,w_3)
To access one of them:
W[[1]]
How do I do that on the shiny server?