The R Project SVN R

Rev

Rev 88943 | 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>Included

conditional content.
</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;">&#8288;\Sexpr&#8288;</code></h3>

<p>Yihui Xie's example:
</p>
<dl>
<dt>def</dt><dd><p>ghi</p>
</dd></dl>

<p>&ndash;
<code style="white-space: pre;">&#8288;
&gt; cat("\noutput\n")
output
&#8288;</code>
&ndash;
</p>
<p><code style="white-space: pre;">&#8288;
&gt; x&lt;-007
&#8288;</code>
</p>


<h3><code style="white-space: pre;">&#8288;\tabular&#8288;</code></h3>


<table>
<tr>
 <td style="text-align: center;">
    1 </td><td style="text-align: right;"> <a href="https://example.org/a&amp;b#c">linked text in <code style="white-space: pre;">&#8288;\tabular&#8288;</code></a>
    </td><td style="text-align: left;"> <a href="https://example.org/a&amp;b#c">https://example.org/a&amp;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;"> third
    column</td>
</tr>
<tr>
 <td style="text-align: center;">
    --3-- </td><td style="text-align: right;"> third
    row</td><td style="text-align: left;"> 
  </td>
</tr>

</table>



<h3><code style="white-space: pre;">&#8288;\eqn&#8288;</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;">&#8288;\deqn&#8288;</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 &amp; \text{if } x &lt; 0, \\
      1 &amp; \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>