Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prm_distrib Fails when Parameter Has Parentheses #116

Closed
billdenney opened this issue Sep 12, 2018 · 5 comments
Closed

prm_distrib Fails when Parameter Has Parentheses #116

billdenney opened this issue Sep 12, 2018 · 5 comments

Comments

@billdenney
Copy link
Contributor

billdenney commented Sep 12, 2018

One of my parameters is named "ETA(CL)", and this appears to cause the following error:

prm_distrib(xpdb=xpdb)
Error in ETA(CL) : could not find function "ETA"

The traceback() suggests it's an issue with attempting to map a column name to a function for summarization:

> traceback()
18: .f(.x[[i]], ...)
17: map(.x[sel], .f, ...)
16: map_if(ind_list, is_helper, eval_tidy)
15: vars_select_eval(.vars, quos)
14: tidyselect::vars_select(names(.data), !!!quos(...))
13: select.data.frame(.data, !!!dots)
12: select(.data, !!!dots)
11: select_.data.frame(., .dots = cols)
10: dplyr::select_(., .dots = cols)
9: function_list[[i]](value)
8: freduce(value, `_function_list`)
7: `_fseq`(`_lhs`)
6: eval(quote(`_fseq`(`_lhs`)), env, env)
5: eval(quote(`_fseq`(`_lhs`)), env, env)
4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
3: get_data(xpdb, .problem = .problem) %>% dplyr::select_(.dots = cols) %>% 
       dplyr::select_if(.predicate = function(x) length(unique(x)) == 
           1) %>% colnames()
2: drop_fixed_cols(xpdb, .problem, cols = prm_col, quiet = quiet)
1: prm_distrib(xpdb = xpdb)

In my NONMEM model, I'm using:

$ABBR REPLACE ETA(CL)=ETA(2)
@billdenney
Copy link
Contributor Author

A workaround is to not use parentheses in the parameter naming:

Not this:

$ABBR REPLACE ETA(CL)=ETA(2)

But this:

$ABBR REPLACE ETA_CL=ETA(2)

@bguiastr
Copy link
Collaborator

I have seen this error in the past when importing the .ext and .phi files that contain ETA(1), OMEGA(1,1), SIGMA(1,1) and THETA(1), etc. but it was solved by a dplyr update. Are you using the latest tidyverse version? If yes could you please send me a reprex (you can PM me)?

@billdenney
Copy link
Contributor Author

I'm on dplyr 0.7.6. I'll look into making a reprex.

@bguiastr
Copy link
Collaborator

related to #125 ?!

@bguiastr bguiastr added this to the xpose 0.5 milestone Jan 13, 2019
@billdenney
Copy link
Contributor Author

It is almost definitely the same issue. If it happens again with the patch for #125, I’ll reopen this issue or start a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants