Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get warning message when requesting help #278

Closed
ggrothendieck opened this issue May 26, 2022 · 1 comment
Closed

Get warning message when requesting help #278

ggrothendieck opened this issue May 26, 2022 · 1 comment

Comments

@ggrothendieck
Copy link

ggrothendieck commented May 26, 2022

Error description

If this file, called test.R, is in current directory


#' Add two numbers.
#'
#' @param x the first number.
#' @param y the second number.
#' @return The sum.
#' @note This is just a simple example.
#'
#' This function is a simple example intended to show how to use the modules
#' package with roxygen2.
add2 <- function(x, y) x + y

and then I use this on a vanilla instance of R:

box::use(./test)
box::help(test$addfun)

I get this (except I have changed the username below from the actual username for security); however, the help does come up.

Loading required namespace: roxygen2

REDIRECT:topic   add2 -> Rtxt28885142422f [ FAIL ]
REDIRECT:file    Rtxt28885142422f -> Rtxt28885142422f [ FAIL ]starting httpd help server ... done
Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/xxx/AppData/Local/Temp/help/Rtxt28885142422f': No such file or directory

Also

is there some way of getting the help without invoking box::use first? Something like this:

box::help(./test/add2)

I would like to use it only for documentation but do not need to actually create any modules.
Will use source to get the source. Also when I use the use command it complains about
library commands but since I am not actually using the module, just the help I don't want
to see these. Also is it possible to create something analogous to help(package = myPackage)
for the functions in a file that have roxygen2 documentation using box?

R version

platform       x86_64-w64-mingw32                         
arch           x86_64                                     
os             mingw32                                    
system         x86_64, mingw32                            
status         Patched                                    
major          4                                          
minor          1.3                                        
year           2022                                       
month          03                                         
day            10                                         
svn rev        81883                                      
language       R                                          
version.string R version 4.1.3 Patched (2022-03-10 r81883)
nickname       One Push-Up

‘box’ version

1.1.2

@klmr
Copy link
Owner

klmr commented Sep 10, 2022

  1. The warning is a bug in ‘box’, it’s tracked in Limitations to documenting modules? #255. I have a candidate fix, but doing this properly is more complicated than anticipated. However, I should be able to push a fix soon.

  2. I’m afraid the feature request is definitely out of scope for ‘box’: fundamentally, the purpose and long-term vision of ‘box’ is to provide a consistent ecosystem for modules which entirely replaces the use of source in R (and I believe that this aim has been achieved with the current version of ‘box’). Adding support for non-module R code would be actively counter-productive to this intent.

@klmr klmr closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants