Questions tagged [rd]

Use for questions related to the *documentation* of files written in R.

Rd format

R objects are documented in files written in “R documentation” (Rd) format, a simple markup language much of which closely resembles (La)TeX, which can be processed into a variety of formats, including LaTeX, HTML and plain text. The translation is carried out by functions in the tools package called by the script Rdconv in R_HOME/bin and by the installation scripts for packages.

The R distribution contains more than 1300 such files which can be found in the src/library/pkg/man directories of the R source tree, where pkg stands for one of the standard packages which are included in the R distribution.


Source: Writing R Extensions

61 questions
5
votes
0 answers

add page headers to roxygen2 docs

I'm using roxygen2 to document the objects in my R package, as described in the book R packages. I want to insert some text at the top (and bottom) of the doc page for every object, saying for example, "Confidential - Do Not Release". For the HTML…
Andrew Schulman
  • 3,395
  • 1
  • 21
  • 23
4
votes
2 answers

How to insert accented characters in ASCII-encoded Rd files?

Can LaTeX escapes for accents be used in Rd files? I tried the standard \'e and many variants (\'{e}, {\'e}, \\'e, \\'{e}, {\\'e}, etc.), but none is rendered as an accented character in the PDF or HTML output. I want my References section (i.e.…
Thomas
  • 457
  • 2
  • 12
4
votes
0 answers

How can I include non-ascii characters like a proper apostrophe ’ in R help (.Rd files?)

It’s common to want to use grammatical characters like the curly apostrophe in "It’s" in R help files. Using a regular single quote ' ) is not a great solution as ' is used in roxygen line openings (#') and to quote strings (which leads…
tim
  • 3,559
  • 1
  • 33
  • 46
4
votes
1 answer

Documentation of squared bracket `[` function

I have a function in R that looks somewhat like this: setMethod('[', signature(x="stack"),definition=function(x,i,j,drop){ new('class', as(x, "SpatialPointsDataFrame")[i,]) }) I use it to get a single element out of a stacked object. For the…
Marco
  • 43
  • 3
3
votes
1 answer

Can I recognize if current iOS device is used for development?

He All, While I write my apps I thought maybe I could recognize if one of my future app users is a iOS developer. For example check if the current device have any developer certificate installed?
sy77
  • 31
  • 3
3
votes
1 answer

Keep Spaces in Rd Files

I'd like to retain multiple spaces in the \details{} section's text of an Rd help file, which by default are compressed to one single space. The result should look like: Either this is super trivial or impossible. Any ideas out there?
Andri Signorell
  • 1,279
  • 12
  • 23
3
votes
1 answer

How to get the corresponding Rd documentation file of a function

How can we get the source of R Documentation for an existing function (the contents of the *.Rd), say plot or lubridate::ymd. Something for documentations that is similar to fix for functions?
d.b
  • 32,245
  • 6
  • 36
  • 77
3
votes
7 answers

Best way for R&D company to get out of pure "D" mode?

I work for an R&D company in the energy business. We've developed some successful products, but now seem to be spending all our time fixing issues relating to those products. We don't seem to have any time to work on developing new products. Does…
Fred Basset
  • 1,147
  • 1
  • 12
  • 10
3
votes
2 answers

Access elements from R's Rd file?

I wish to go through a package and discover who are the authors mentioned for each function's help file. I looked for a function to extract elements from R's help file, and could find one. The closest I could find is this post, from Noam Ross. Does…
Tal Galili
  • 24,605
  • 44
  • 129
  • 187
2
votes
2 answers

'RD' command not returning '0' or '1' as errorlevel on success or failure

I am using the RD command in my batch script to remove a directory. I assumed RD should return 0 for success, or 1 for failure. but it doesn't appear to do so. I am using the Robocopy command utility before the RD command, and its taking the…
Raj
  • 31
  • 2
2
votes
2 answers

Behavior of `R CMD build` depending of Rd content

R CMD build behaves differently whether a Rd file contains \PR{} or not. See Writing R Extensions for details on the macros. Example when a Rd file does not contain \PR{}: $ R CMD build test * checking for file 'test/DESCRIPTION' ... OK * preparing…
Thomas
  • 457
  • 2
  • 12
2
votes
2 answers

Automatically documenting multiple S3 methods in one file

Since initially running package.skeleton to create a package, I have added several S3 classes. Each of these classes has 5-10 methods. I've discovered the wonderful prompt command to create .Rd files from a function loaded into memory, but is it…
Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
2
votes
0 answers

Does roxygen2 use a "prefix is known" heuristic?

Hypothesis Roxygen2 uses a heuristic. If the prefix preceding the period is known (merge, cut), the method is an S3 method, otherwise (slice), it is an ordinary method. Question Is this heuristic documented? More importantly, is there a way to avert…
Vrokipal
  • 784
  • 5
  • 18
2
votes
1 answer

Show an Rd file in viewer from Rstudio

I have documentation for functions and datasets in a project folder. In a documentation folder, I have .Rd files for all the datasets. I'd like the user to be able to call a custom help function and launch the .Rd file in the viewer as is done…
AdamO
  • 4,283
  • 1
  • 27
  • 39
2
votes
1 answer

generating .R file from .Rd file

I know roxygen2::roxygenise() or devtools::document() cane be used to generate .Rd file from .R file. For example, if Test.R is as follow #' Add together two numbers #' #' @param x A number #' @param y A number #' @return The sum of \code{x} and…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309