Bug: derive_param_wbc_abs()
doesn't handle environments properly
#2507
Replies: 4 comments
-
I got it work by adding Conflicts with base::filter() on my setup. |
Beta Was this translation helpful? Give feedback.
-
How so? I wouldn't have expected it to work with that extra call and indeed for me it does not? |
Beta Was this translation helpful? Give feedback.
-
The code works if
is used. I wouldn't consider this as a bug because in the expression specified for To improve the user's experience we could catch the "object not found" error and provide some hints like "Did you misspell the object name or miss unquoting (see https://pharmaverse.github.io/admiral/articles/concepts_conventions.html#exprs for guidance on quoting and unquoting)?" |
Beta Was this translation helpful? Give feedback.
-
Yes, this sounds like a good idea thank @bundfussr - maybe could be discussed in the environments WG. |
Beta Was this translation helpful? Give feedback.
-
What happened?
A user at Roche called
derive_param_wbc_abs()
from within a wrapper function, and tried to pass to the former some objects defined only within the wrapper function. However, these objects were not recognised byderive_param_wbc_abs()
.I think it's the same sort of error that we encountered and fixed for
slice_derivation()
andcall_derivation()
in #2244, it's symptomatic of poor environment handling by some of the {admiral} functions. We should probably do a more thorough review of the {admiral} codebase to identify other cases where this occurs, and proactively fix them.Session Information
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] admiral_1.1.1.9004 tibble_3.2.1
loaded via a namespace (and not attached):
[1] tidyr_1.3.1 utf8_1.2.4 R6_2.5.1
[4] lubridate_1.9.3 tidyselect_1.2.1 magrittr_2.0.3
[7] glue_1.7.0 stringr_1.5.1 pkgconfig_2.0.3
[10] timechange_0.3.0 generics_0.1.3 dplyr_1.1.4
[13] lifecycle_1.0.4 cli_3.6.2 fansi_1.0.6
[16] vctrs_0.6.5 withr_3.0.0 compiler_4.3.3
[19] admiraldev_1.1.0.9001 purrr_1.0.2 rstudioapi_0.16.0
[22] tools_4.3.3 hms_1.1.3 pillar_1.9.0
[25] rlang_1.1.3 stringi_1.8.3
Reproducible Example
This should work but does not:
But it does work if you unravel the dummy function
my_fn()
.Beta Was this translation helpful? Give feedback.
All reactions