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
23
votes
1 answer

Hyperlink in R document

I am writing an R document (Rd) for functions. In markdown, we can create a hyperlink by [google](https://www.google.com). How can I replicate this in R document? It seems that \link{...} can only create a link, which is different from what I am…
semibruin
  • 963
  • 1
  • 9
  • 18
20
votes
1 answer

documenting dataset with roxygen2

I'm trying to document some datasets in an R package using roxygen2. Considering just one of these: I have mypkg/data/CpG.human.GRCh37.RDa which contains an object called CpG.human.GRCh37 and a file called: mypkg/R/cpg-data.R, which contains: #'…
drmjc
  • 659
  • 1
  • 6
  • 10
19
votes
1 answer

How to access the help/documentation .rd source files in R?

In R, one very neat feature is that the source code of functions is accessible as objects in the workspace. Thus, if I wanted to know the source code of, for example, grep() I can simply type grep into the console and read the code. Similarly, I can…
Andrie
  • 176,377
  • 47
  • 447
  • 496
15
votes
1 answer

Including images in R-package documentation (.Rd) files

I am working to document a visualization function in a package of mine. For this purpose I would like to have an image embedded through the Rd-file 'funcname.Rd' that could explain various parameters utilized in the function, and which would pop up…
Teemu Daniel Laajala
  • 2,316
  • 1
  • 26
  • 37
15
votes
2 answers

Subscript of math equation in R documentation

I'm trying to insert an equation in to an R documentation such that: \deqn{p_{x}(1)=Pr(y=1|x)} but it does come out as I expected where x is a subscript of p. Does anybody know the reason OR how to subscript p in R documentation?
David Z
  • 6,641
  • 11
  • 50
  • 101
14
votes
2 answers

.Rd links to suggested package

My hyperSpec package provides functions to work with spectoscopic data sets. I provide hyperSpec-methods for quite a number of functions coming from other packages. However, some of these other packages, I have listed as Suggests: as I do not want…
cbeleites unhappy with SX
  • 13,717
  • 5
  • 45
  • 57
11
votes
2 answers

Generate items with multiple arguments in an R documentation via roxygen2

To generate an R documentation file (.Rd) I use the package RStudio/Document option with R 3.0.2, Linux 3.11, devtools 1.5, roxygen2 4.0.1. Objective I want to describe multiple arguments of a function in the documentation file, such as in this…
setempler
  • 1,681
  • 12
  • 20
9
votes
2 answers

devtools roxygen package creation and rd documentation

I am new to roxygen and am struggling to see how to be able to use it to quickly create a new/custom package. I.e. I would like to know the minimum requirements are to make a package called package1 using devtools, roxygen2/3 so that I can run the…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
8
votes
2 answers

how do I document an R Reference Class?

how do I document the use of member functions of a reference class? if I write a Rd file with a \usage block, how do I avoid the WARNING Functions/methods with usage in documentation object 'XmlDoc' but not in code: $ new I'd expect the \usage…
mariotomo
  • 9,438
  • 8
  • 47
  • 66
8
votes
2 answers

Is it possible to use nested item in .Rd?

I can use \item to make a list in .Rd files. \item{blah}{blah} But it seems that I can not create a nested list by put \item within another \item as in \item{blah}{ \item{blah1}{some} \item{blah2}{thing} } Does anybody know a way to generate a…
user1424739
  • 11,937
  • 17
  • 63
  • 152
7
votes
1 answer

Using unbalanced brace in Roxygen/Rd code example

The following MWE fails to compile (via devtools::document()): #' MWE #' #' @examples #' format('{}') # Works #' format('{') # Nope #' format('\{') # Nope #' format('\\{')# Nope format = function (str) {} Regardless of which of the “Nope” lines I…
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
7
votes
1 answer

Exporting data in Roxygen2 so that they are available without requiring data()

After reading questions such as this SO question on documenting a data set with Roxygen I have managed to document a dataset (which I will refer to as cells) and it now appears in the list generated by data(package="mypackage") and is loaded if I…
seancarmody
  • 6,182
  • 2
  • 34
  • 31
6
votes
0 answers

How to document a defunct function properly?

What I have read I have read this SO question and related answers but I am still a bit at loss of how to document a defunct function properly in my package. What I have tried I replaced the code of my defunctfucntion by a call of .Defunct("
thothal
  • 16,690
  • 3
  • 36
  • 71
6
votes
2 answers

Converting .Rd file to plain text

I'm trying to convert R documentation files (extension .Rd) into plain text. I am aware that RdUtils contains a tool called Rdconv, but as far as I know it can only be used from the command line. Is there a way to access Rdconv (or a similar…
RedShift
  • 275
  • 1
  • 9
6
votes
3 answers

How can I retain the initial white space in a line when writing Rd documentation?

In conjunction with trying to find a solution for myself in regards to this question, I find myself plunged into trying to write valid Rd markup. What I want is to add a section named Raw Function Code and put the code of the function under it. …
russellpierce
  • 4,583
  • 2
  • 32
  • 44
1
2 3 4 5