Rev 89884 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
<!DOCTYPE html><html><head><title>R: An Rd Regression Test</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css"><script>const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"};function processMathHTML() {var l = document.getElementsByClassName('reqn');for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }return;}</script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.js"onload="processMathHTML();"></script><link rel="stylesheet" type="text/css" href="R.css"></head><body><div class="container"><main><table style="width: 100%;"><tr><td>testit</td><td style="text-align: right;">R Documentation</td></tr></table><h2>An Rd Regression Test</h2><h3>Usage</h3><pre><code class='language-R'>\x \y %{}foo(<var>x</var>, <var>y</var>, ...)</code></pre><h3>Arguments</h3><table role = "presentation"><tr><td><code id="x">x</code>, <code id="y">y</code></td><td><p>combined arguments, in multiple Rd lines</p><p>paragraph</p></td></tr><tr><td><code id="...">...</code></td><td><p>description of ...: ...</p></td></tr></table><h3>Details</h3><p>Includedconditional content.End(<code style="white-space: pre;">⁠#ifdef⁠</code>).</p><p>Escaped backslash <code>\x</code>.</p><p><code>%{}</code></p><p>a link and some to known destinations:<code>weighted.mean</code>, dito,<code>{</code>, <span class="env">R_HOME</span>.</p><p>var in <var>text</var>.</p><p><code>foo(<var>x</var>, <var>y</var>)</code>.</p><p>Preformatted:</p><pre>Escaped backslash \x.%{}var in \var{text}.foo(\var{x}, \var{y}).From gap: pedtodot.Rd -- n=split(m,par,"\034")</pre><h3>Value</h3><p>[NULL]<br><br>...</p><h3><code style="white-space: pre;">⁠\Sexpr⁠</code></h3><p>Yihui Xie's example:</p><dl><dt>def</dt><dd><p>ghi</p></dd></dl><p>–<code style="white-space: pre;">⁠> cat("\noutput\n")output⁠</code>–</p><p><code style="white-space: pre;">⁠> x<-007⁠</code></p><p>Georgi Boshnakov's example of generated paragraphs:a</p><p>b</p><p>c</p><p><em>one</em>two<em>one</em>two</p><p><code style="white-space: pre;">⁠[1] "a\n b\n c"⁠</code></p><p>R (2025).“<code class="reqn">t</code>.”</p><h3><code style="white-space: pre;">⁠\tabular⁠</code></h3><table><tr><td style="text-align: center;">1 </td><td style="text-align: right;"> <a href="https://example.org/a&b#c">linked text in <code style="white-space: pre;">⁠\tabular⁠</code></a></td><td style="text-align: left;"> <a href="https://example.org/a&b#c">https://example.org/a&b#c</a></td></tr><tr><td style="text-align: center;">2 </td><td style="text-align: right;"> 2nd-column entry with <em>line break</em>in Rd source</td><td style="text-align: left;"> thirdcolumn</td></tr><tr><td style="text-align: center;">--3-- </td><td style="text-align: right;"> thirdrow</td><td style="text-align: left;"></td></tr></table><h3><code style="white-space: pre;">⁠\eqn⁠</code></h3><p>This should not start a new paragraph:<code class="reqn">\frac{1}{n-1}</code>.</p><h3><code style="white-space: pre;">⁠\deqn⁠</code></h3><p>1-arg form, centered also in text conversion:</p><p style="text-align: center;"><code class="reqn">\theta = (\mu^*, \sigma^2, \rho)</code></p><p>2-arg form, where the text version is collapsed before centering(for the sake of existing Rd files):</p><p style="text-align: center;"><code class="reqn">E = mc^2</code></p><p>With AMS extension (R <code class="reqn">\ge</code> 4.2.2),where the text version spans more than 3 source lines (5 in fact)and is thus output as-is in R <code class="reqn">\ge</code> 4.4.0:</p><p style="text-align: center;"><code class="reqn">f(x) = \begin{cases}0 & \text{if } x < 0, \\1 & \text{if } x \ge 0.\end{cases}</code></p><h3>Examples</h3><pre><code class='language-R'>\x%{}## Not run: stop("doomed to fail")foo(<var>x</var>,<var>y</var>)</code></pre></main></div></body></html>