Its hard to do a reprex for this, so I'll do my best to explain.
I have a mixture of scripts and functions in a
utils.R file as part of a package. All its content is intended to be for internal use and not exported. One line is causing me headaches.
# magic vars ==== #' @noRd #' @importFrom magrittr %>% #' @importFrom stringr str_to_lower t1.label. <- Sys.getenv("T1_LABEL") %>% str_to_lower()
It seems the assignment is evaluated at build time. I've tried
t1.label. <- force(Sys.getenv("T1_LABEL")) %>% str_to_lower()
but this doesn't make any difference. How can I get the assignment to be made against the env. variables on the machine (usually a Docker container) that the package is deployed to?