Closed klmr closed 2 years ago
Currently ‘box’ assumes that ‘rstudioapi’ is installed if the code is run from inside RStudio:
https://github.com/klmr/box/blob/0345109492c166b13edd0a4c151e1fa2a81dfab4/R/paths.r#L193
However, this is apparently not always the case. Make code conditional on the package’s existence, or avoid depending on it altogether.
Could probably be implemented as as.environment("tools:rstudio")$.rs.api.getActiveDocumentContext()$path. Caveat: this uses private (?) RStudio APIs.
as.environment("tools:rstudio")$.rs.api.getActiveDocumentContext()$path
See unresolved comment on 461c706.
Currently ‘box’ assumes that ‘rstudioapi’ is installed if the code is run from inside RStudio:
https://github.com/klmr/box/blob/0345109492c166b13edd0a4c151e1fa2a81dfab4/R/paths.r#L193
However, this is apparently not always the case. Make code conditional on the package’s existence, or avoid depending on it altogether.