Comments (3)
I’m tempted to say “by design” – this is really neither surprising nor inconsistent, and in Python you’d have the same problem. The solution is furthermore straightforward: use an absolute path. But of course there should be an easy way of getting the absolute path of the current module (it works, very convolutedly, via attr(parent.env(environment()), 'path')
), e.g. by hooking into system.file
.
from box.
Yep, something like module_path
or module_relative_path("some/path")
would be nice.
from box.
module_file()
retrieves the root path for a module, or getwd()
when invoked outside a module.
module_file('a')
retrieves path of a
… etc. Usage is analogous to system.file
.
from box.
Related Issues (20)
- Add support for `Rcpp::sourceCpp` inside a `box` module HOT 3
- Import directories HOT 4
- Allow tidyselect-like syntax within `use()` HOT 2
- GitHub version is broken: ERROR: a 'NAMESPACE' file is required; object 'c_strict_extract' not found HOT 3
- Nested packages and relative paths HOT 2
- Add contribution instructions
- Rename ‘dev’ branch to ‘build’
- `box::use` with relative paths does not seem to work with Plumber APIs with `entrypoint.R` deployed to RStudio / Posit Connect HOT 3
- Documentation not found for reexports HOT 3
- Unable to install `box` with `renv=1.0.0` HOT 2
- Check `...` arguments in`box::file()` and `box::export()`
- recent versions do not install with R 3.6.3 (object '.S3method' not found) HOT 5
- Document limitation of replacement functions in modules HOT 1
- installation fails under R version 3.6.0: object '.S3method' not found HOT 2
- Consider making ‘box’ namespace environments actual namespaces HOT 5
- Read environment variables only at startup
- Move backports definitions to on_load()
- Nested imports don't work when set as `R6` class method HOT 4
- `purge_cache` function missing HOT 1
- Ability to re-export functions that have been loaded programmatically HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box.