-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
Hello, I was getting the following error when trying to produce a parameter table from an SAEM model:
get_prm(xp,show_all = T,transform = FALSE)
Returning parameter estimates from $prob no.1, subprob no.0, method saem
Error in if (n_theta != length(theta_names)) { :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: Unknown columns: `OBJ`
2: Unknown columns: `OBJ`
3: Unknown columns: `OBJ`
The issue is that when using SAEM the the last column of the .ext file is called SAEMOBJ. This column is not excluded in the get_iter() function. I could simply patch this bug by correcting get_iter():
grab_iter <-
function (ext, iter)
{
out <- ext %>% dplyr::filter(.$ITERATION == iter) %>% dplyr::select(-dplyr::one_of("ITERATION",
"OBJ","SAEMOBJ")) # added SAEMOBJ here
if (nrow(out) == 0)
out[1, ] <- NA_real_
purrr::flatten(out)
}