Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

box::help() is not working as I thought it would for re-exported modules. I will get as close to a reprex as I can, as I can't seem to get {reprex} to work with this code yet. Below is layout, important file contents, and code example of failure (and how I can get success):

Code that fails (and works):

> #;; module-help.R
> 
> #;; Does not work
> box::use(mymod = ../foo)
> mymod$hello("me")
[1] "me"
> tryCatch({
+     box::help(mymod$hello)
+ },
+ error=function(e) glue::glue("{e}"))
Error in box::help(mymod$hello): no documentation available for "hello" in module "../foo"

> 
> #;; This does work, last help command pops up help file.
> box::use(moddirect = ../foo/bar)
> moddirect$hello("me")
[1] "me"
> box::help(moddirect$hello)

Directory layout:

.
|-- R
|   `-- module-help.R
|-- box-pkg-demo.Rproj
`-- foo
    |-- __init__.R
    `-- bar.R

__init__.R contents:

#' @export
box::use(./bar[...])

bar.R contents:

#' hello
#'
#' Prints out argument.
#'
#' @param nm String.  Name
#'
#' @return Invisible string.
#' @export
hello = function(nm) {
    print(nm)
}
You must be logged in to vote

Yes, that’s a bug: #330. Unfortunately fixing it isn’t trivial, but it’s on my list.

Replies: 1 comment

Comment options

Yes, that’s a bug: #330. Unfortunately fixing it isn’t trivial, but it’s on my list.

You must be logged in to vote
0 replies
Answer selected by mpettis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.