Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preview development R documentation

I'm writing my first R Package using devtools and roxygen2 in the RStudio IDE. The problem I have is related with previewing the .Rd files I get when I "roxygenize" the .R files. I'm using devtools::document() in order to get the .Rd files, but when I try to preview the Help Pages by writing any of:

help("FunctionName")
?FunctionName

the console shows the message "Using development documentation for..." but there's a blank space in the help window. Using devtools:load_all() causes the same problem. Maybe this is related with the way devtools loads the package in the environment, but neither the document "Writing R Extensions" (that isn't expected to be consulted to use roxygen), nor the book "R packages" by Hadley Wickham provides a working solution.

like image 627
Servadac Avatar asked Sep 02 '16 12:09

Servadac


People also ask

How do you do documentation in R?

Use the File -> New -> R Documentation command in RStudio. This command will allow you to specify the name of an existing function or dataset to use as the basis for the Rd file or alternatively will create a new empty Rd file.

How do I view documents in R?

Press ctrl+3 to show it.

How do I preview pictures in R‑studio?

Pictures can be previewed either as tiles within the main window of R‑Studio or in an external previewer. Tile size can be changed.. Picture files can be zoomed in/out and rotated. Video and audio files can be played even without their respective application installed.

How to create an your documentation file in R?

Use the File -> New -> R Documentation command in RStudio. This command will allow you to specify the name of an existing function or dataset to use as the basis for the Rd file or alternatively will create a new empty Rd file.

How long is the preview version of RStudio?

If you haven’t yet licensed the product then the preview provides a 45-day evaluation version subject to the RStudio End User License Agreement.

How do I preview a deleted file in R-studio?

We are committed to providing fast, efficient, and affordable software solutions that set new standards in the software development industry. R‑Studio has a built-in file previewer that allows you to preview both existing and deleted files. You may use this feature to estimate chances for successful file recovery or to find a file to recover.


1 Answers

In Rstudio under project options there is a generate documentation with roxygen item - check it.

enter image description here

Then click on Configure... and check the boxes like that:

enter image description here

Now, each time you hit Ctrl+Shift+B your doc files will be rebuild and you can browse them via clicking on the function name and hitting F1 or typing one of the following lines in the console:

?my_function
help(my_function)
like image 131
petermeissner Avatar answered Sep 17 '22 07:09

petermeissner