Skip to content

Search for modules after packages has been exhausted #307

@jtlandis

Description

@jtlandis

Please describe your feature request

Lets assume you have set the systems R_BOX_PATH environment variable to something like /opt/box. It would be convenient to take advantage of the __init__.r usage pattern with modules within /opt/box.

For example, suppose the following directory structure in /opt/box

foo/__init__.r

#' @export
box::use(./mod1[...], ./mod2[...])

foo/mod1.r

#' @export
bar <- 1L

foo/mod2.r

#' @export
baz <- 2L

Then, the expected result may look something like this:

box::use(foo)

foo$bar # 1L
foo$baz # 2L

Instead, we currently get an error dictating that there is no package named foo. Thus back to my point, to there being some convenience if box would then start searching the paths.

I am aware that if R_BOX_PATH had /opt set, then the following usage may work

box::use(box/foo)

But in my case, there may be other things within /opt that I do not want the box package to walk over.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions