timjmiller / wham

State-space, age-structured fish stock assessment model
https://timjmiller.github.io/wham
Other
32 stars 16 forks source link

minor bug in par_table_fn.R function #83

Closed JDeroba closed 10 months ago

JDeroba commented 10 months ago

There are multiple locations in the par_table_fn.R function where the code references input$... but should be mod$input$...

These all occur in places conditional on M being estimated as a fixed effect or the use of an ecov option. So it probably works fine most of the time, but in these cases no res_tables are produced. I think this would be a five minute fix.

code chunks I believe are in error:

age.list = M_a_point = list() M_map = as.integer(as.character(input$map$M_a)) ind = unique(M_map[which(!is.na(M_map))])

fe.names = c(fe.names, paste0("Ecov: ", data$Ecov_label[[1]][i], " obs. sd.")) ind = which(!is.na(matrix(input$map$Ecov_obs_logsigma, NROW(input$par$Ecov_obs_logsigma))[,i]))[1] fe.vals = c(fe.vals, exp(pars$Ecov_obs_logsigma[ind,i]))

timjmiller commented 10 months ago

bug is fixed on devel branch commit