Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
Regard the updated parameter order in the match function
  • Loading branch information
Jaimemosg committed Oct 22, 2023
1 parent 51a5007 commit 5444d57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/maxlogLreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,10 @@ set_values <- function(input, n_betas, par_names, par_order,
# Reorder the parameters test[[1]] <- input[[1]][c(3,1,2)]
input_order <- match(par_names, names(input))
input <- input[input_order]
reg_order <- apply(matrix(1:npar, nrow = npar), MARGIN = 1,
FUN = function(x) match(b_names[[x]], input_names[[x]]))
reg_order <- apply(
matrix(1:npar, nrow = npar), MARGIN = 1,
FUN = function(x) match(b_names[[x]], input_names[input_order][[x]])
)
na_pos <- lapply(lapply(reg_order, is.na), which)
reg_order <- lapply(lapply(reg_order, na.omit), as.numeric)
input <- apply(matrix(1:npar, nrow = npar), MARGIN = 1,
Expand Down

0 comments on commit 5444d57

Please sign in to comment.