EVOLUTION-MANAGER
Edit File: rd-other.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="generator" content="pandoc" /> <meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Documenting other objects</title> <script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to // be compatible with the behavior of Pandoc < 2.8). document.addEventListener('DOMContentLoaded', function(e) { var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); var i, h, a; for (i = 0; i < hs.length; i++) { h = hs[i]; if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 a = h.attributes; while (a.length > 0) h.removeAttribute(a[0].name); } }); </script> <style type="text/css"> code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} </style> <style type="text/css"> code { white-space: pre; } .sourceCode { overflow: visible; } </style> <style type="text/css" data-origin="pandoc"> pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ </style> <script> // apply pandoc div.sourceCode style to pre.sourceCode instead (function() { var sheets = document.styleSheets; for (var i = 0; i < sheets.length; i++) { if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue; try { var rules = sheets[i].cssRules; } catch (e) { continue; } for (var j = 0; j < rules.length; j++) { var rule = rules[j]; // check if there is a div.sourceCode rule if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue; var style = rule.style.cssText; // check if color or background-color is set if (rule.style.color === '' && rule.style.backgroundColor === '') continue; // replace div.sourceCode by a pre.sourceCode rule sheets[i].deleteRule(j); sheets[i].insertRule('pre.sourceCode{' + style + '}', j); } } })(); </script> <style type="text/css">body { background-color: #fff; margin: 1em auto; max-width: 700px; overflow: visible; padding-left: 2em; padding-right: 2em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.35; } #TOC { clear: both; margin: 0 0 10px 10px; padding: 4px; width: 400px; border: 1px solid #CCCCCC; border-radius: 5px; background-color: #f6f6f6; font-size: 13px; line-height: 1.3; } #TOC .toctitle { font-weight: bold; font-size: 15px; margin-left: 5px; } #TOC ul { padding-left: 40px; margin-left: -1.5em; margin-top: 5px; margin-bottom: 5px; } #TOC ul ul { margin-left: -2em; } #TOC li { line-height: 16px; } table { margin: 1em auto; border-width: 1px; border-color: #DDDDDD; border-style: outset; border-collapse: collapse; } table th { border-width: 2px; padding: 5px; border-style: inset; } table td { border-width: 1px; border-style: inset; line-height: 18px; padding: 5px 5px; } table, table th, table td { border-left-style: none; border-right-style: none; } table thead, table tr.even { background-color: #f7f7f7; } p { margin: 0.5em 0; } blockquote { background-color: #f6f6f6; padding: 0.25em 0.75em; } hr { border-style: solid; border: none; border-top: 1px solid #777; margin: 28px 0; } dl { margin-left: 0; } dl dd { margin-bottom: 13px; margin-left: 13px; } dl dt { font-weight: bold; } ul { margin-top: 0; } ul li { list-style: circle outside; } ul ul { margin-bottom: 0; } pre, code { background-color: #f7f7f7; border-radius: 3px; color: #333; white-space: pre-wrap; } pre { border-radius: 3px; margin: 5px 0px 10px 0px; padding: 10px; } pre:not([class]) { background-color: #f7f7f7; } code { font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 85%; } p > code, li > code { padding: 2px 0px; } div.figure { text-align: center; } img { background-color: #FFFFFF; padding: 2px; border: 1px solid #DDDDDD; border-radius: 3px; border: 1px solid #CCCCCC; margin: 0 5px; } h1 { margin-top: 0; font-size: 35px; line-height: 40px; } h2 { border-bottom: 4px solid #f7f7f7; padding-top: 10px; padding-bottom: 2px; font-size: 145%; } h3 { border-bottom: 2px solid #f7f7f7; padding-top: 10px; font-size: 120%; } h4 { border-bottom: 1px solid #f7f7f7; margin-left: 8px; font-size: 105%; } h5, h6 { border-bottom: 1px solid #ccc; font-size: 105%; } a { color: #0033dd; text-decoration: none; } a:hover { color: #6666ff; } a:visited { color: #800080; } a:visited:hover { color: #BB00BB; } a[href^="http:"] { text-decoration: underline; } a[href^="https:"] { text-decoration: underline; } code > span.kw { color: #555; font-weight: bold; } code > span.dt { color: #902000; } code > span.dv { color: #40a070; } code > span.bn { color: #d14; } code > span.fl { color: #d14; } code > span.ch { color: #d14; } code > span.st { color: #d14; } code > span.co { color: #888888; font-style: italic; } code > span.ot { color: #007020; } code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #900; font-weight: bold; } code > span.er { color: #a61717; background-color: #e3d2d2; } </style> </head> <body> <h1 class="title toc-ignore">Documenting other objects</h1> <div id="datasets" class="section level2"> <h2>Datasets</h2> <p>Datasets are stored in <code>data/</code>, not as regular R objects in the package. This means you need to document them in a slightly different way: instead of documenting the data directly, you quote the dataset’s name.</p> <div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">#' Prices of over 50,000 round cut diamonds</span></span> <span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co">#'</span></span> <span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co">#' A dataset containing the prices and other attributes of almost 54,000</span></span> <span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co">#' diamonds. The variables are as follows:</span></span> <span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co">#'</span></span> <span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co">#' @format A data frame with 53940 rows and 10 variables:</span></span> <span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="co">#' \describe{</span></span> <span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{price}{price in US dollars ($326--$18,823)}</span></span> <span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{carat}{weight of the diamond (0.2--5.01)}</span></span> <span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{cut}{quality of the cut (Fair, Good, Very Good, Premium, Ideal)}</span></span> <span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{color}{diamond colour, from D (best) to J (worst)}</span></span> <span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{clarity}{a measurement of how clear the diamond is (I1 (worst), SI2,</span></span> <span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="co">#' SI1, VS2, VS1, VVS2, VVS1, IF (best))}</span></span> <span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{x}{length in mm (0--10.74)}</span></span> <span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{y}{width in mm (0--58.9)}</span></span> <span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{z}{depth in mm (0--31.8)}</span></span> <span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{depth}{total depth percentage = z / mean(x, y) = 2 * z / (x + y) (43--79)}</span></span> <span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="co">#' \item{table}{width of top of diamond relative to widest point (43--95)}</span></span> <span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a><span class="co">#' }</span></span></code></pre></div> <p>Note the use of two additional tags that are particularly useful for documenting data:</p> <ul> <li><p><code>@format</code>, which gives an overview of the structure of the dataset. This should include a <strong>definition list</strong> that describes each variable. There’s currently no way to generate this with Markdown, so this is one of the few places you’ll need to Rd markup directly.</p></li> <li><p><code>@source</code> where you got the data form, often a URL.</p></li> </ul> </div> <div id="packages" class="section level2"> <h2>Packages</h2> <p>As well as documenting every object inside the package, you can also document the package itself by documenting the special sentinel <code>"_PACKAGE"</code>. This automatically include information parsed from the <code>DESCRIPTION</code>, including title, description, list of authors, and useful URLs.</p> <p>We recommend placing package documentation in <code>{pkgname}-package.R</code>, and have <code>@keywords internal</code>. Use <code>usethis::use_package_doc()</code> to set up automatically.</p> <p>Here’s an example:</p> <div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co">#' @keywords internal </span></span> <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="st">"_PACKAGE"</span></span></code></pre></div> <p>Package documentation is a good place to put <code># Package options</code> that documents options used by the package.</p> <p>Some notes:</p> <ul> <li><p>By default, aliases will be added so that both <code>?pkgname</code> and <code>package?pkgname</code> will find the package help. If there’s an existing function called <code>pkgname</code>, use <code>@aliases {pkgname}-package NULL</code> to override the default.</p></li> <li><p>Use <code>@references</code> to point to published material about the package that users might find helpful.</p></li> </ul> </div> <div id="s3" class="section level2"> <h2>S3</h2> <ul> <li><p>S3 <strong>generics</strong> are regular functions, so document them as such. If necessary, include a section that provides additional details for developers implementing methods.</p></li> <li><p>S3 <strong>classes</strong> have no formal definition, so document the <a href="https://adv-r.hadley.nz/s3.html#s3-constructor">constructor</a>.</p></li> <li><p>It is your choice whether or not to document S3 <strong>methods</strong>. Generally, it’s not necessary to document straightforward methods for common generics like <code>print()</code>. (You should, however, always <code>@export</code> S3 methods).</p> <p>If your method is more complicated, you should document it by setting <code>@rdname</code> or <code>@describeIn</code>. For complicated methods, you might document in their own file (i.e. <code>@rdname generic.class</code>; for simpler methods you might document with the generic (i.e. <code>@describeIn generic)</code>. Learn more about these tags in <code>vignette("reuse")</code>.</p></li> <li><p>Generally, roxygen2 will automatically figure out the generic that the method belongs to, and you should only need to use <code>@method</code> if there is ambiguity. For example, is <code>all.equal.data.frame()</code> the <code>equal.data.frame</code> method for <code>all()</code>, or the <code>data.frame</code> method for <code>all.equal()</code>?. If this happens to you, disambiguate with (e.g.) <code>@method all.equal data.frame</code>.</p></li> </ul> </div> <div id="s4" class="section level2"> <h2>S4</h2> <p>S4 <strong>generics</strong> are also functions, so document them as such.</p> <p>Document <strong>S4 classes</strong> by adding a roxygen block before <code>setClass()</code>. Use <code>@slot</code> to document the slots of the class. Here’s a simple example:</p> <div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">#' An S4 class to represent a bank account</span></span> <span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co">#'</span></span> <span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="co">#' @slot balance A length-one numeric vector</span></span> <span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>Account <span class="ot"><-</span> <span class="fu">setClass</span>(<span class="st">"Account"</span>,</span> <span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="at">slots =</span> <span class="fu">list</span>(<span class="at">balance =</span> <span class="st">"numeric"</span>)</span> <span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div> <p>S4 <strong>methods</strong> are a little more complicated. Unlike S3 methods, all S4 methods must be documented. You can document them in three places:</p> <ul> <li><p>In the class. Most appropriate if the corresponding generic uses single dispatch and you created the class.</p></li> <li><p>In the generic. Most appropriate if the generic uses multiple dispatches and you control it.</p></li> <li><p>In its own file. Most appropriate if the method is complex. or the either two options don’t apply.</p></li> </ul> <p>Use either <code>@rdname</code> or <code>@describeIn</code> to control where method documentation goes. See the next section for more details.</p> </div> <div id="r6" class="section level2"> <h2>R6</h2> <ul> <li><p>R6 methods can be documented in-line, i.e. the method’s documentation comments come right before the definition of the method.</p></li> <li><p>Method documentation can use the <code>@description</code>, <code>@details</code>, <code>@param</code>, <code>@return</code> and <code>@examples</code> tags. These are used to create a subsection for the method, within a separate ‘Methods’ section. All roxygen comment lines of a method documentation must appear after a tag.</p></li> <li><p><code>@param</code> tags that appear before the class definition are automatically inherited by all methods, if needed.</p></li> <li><p>R6 fields and active bindings can make use of the <code>@field</code> tag. Their documentation should also be in-line.</p></li> <li><p>roxygen2 checks that all public methods, public fields, active bindings and all method arguments are documented, and issues warnings otherwise.</p></li> <li><p>To turn off the special handling of R6 classes and go back to the roxygen2 6.x.x behavior, use the <code>r6 = FALSE</code> option in <code>DESCRIPTION</code>, in the <code>Roxygen</code> entry: <code>Roxygen: list(r6 = FALSE)</code>.</p></li> </ul> <p>roxygen2 automatically generates additional sections for an R6 class:</p> <ul> <li><p>A section with information about the superclass(es) of the class, with links. In HTML this includes a list of all inherited methods, with links.</p></li> <li><p>An ‘Examples’ section that contains all class and method examples. This section is run by <code>R CMD check</code>, so method examples must work without errors.</p></li> </ul> <p>An example from the R6 tutorial:</p> <div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co">#' R6 Class Representing a Person</span></span> <span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="co">#'</span></span> <span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co">#' @description</span></span> <span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co">#' A person has a name and a hair color.</span></span> <span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="co">#'</span></span> <span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a><span class="co">#' @details</span></span> <span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="co">#' A person can also greet you.</span></span> <span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a>Person <span class="ot"><-</span> R6<span class="sc">::</span><span class="fu">R6Class</span>(<span class="st">"Person"</span>,</span> <span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a><span class="at">public =</span> <span class="fu">list</span>(</span> <span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @field name First or full name of the person.</span></span> <span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="cn">NULL</span>,</span> <span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @field hair Hair color of the person.</span></span> <span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> <span class="at">hair =</span> <span class="cn">NULL</span>,</span> <span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @description</span></span> <span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a> <span class="co">#' Create a new person object.</span></span> <span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @param name Name.</span></span> <span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @param hair Hair color.</span></span> <span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @return A new `Person` object.</span></span> <span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> <span class="at">initialize =</span> <span class="cf">function</span>(<span class="at">name =</span> <span class="cn">NA</span>, <span class="at">hair =</span> <span class="cn">NA</span>) {</span> <span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a> self<span class="sc">$</span>name <span class="ot"><-</span> name</span> <span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a> self<span class="sc">$</span>hair <span class="ot"><-</span> hair</span> <span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> self<span class="sc">$</span><span class="fu">greet</span>()</span> <span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> },</span> <span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @description</span></span> <span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a> <span class="co">#' Change hair color.</span></span> <span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @param val New hair color.</span></span> <span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @examples</span></span> <span id="cb4-33"><a href="#cb4-33" aria-hidden="true" tabindex="-1"></a> <span class="co">#' P <- Person("Ann", "black")</span></span> <span id="cb4-34"><a href="#cb4-34" aria-hidden="true" tabindex="-1"></a> <span class="co">#' P$hair</span></span> <span id="cb4-35"><a href="#cb4-35" aria-hidden="true" tabindex="-1"></a> <span class="co">#' P$set_hair("red")</span></span> <span id="cb4-36"><a href="#cb4-36" aria-hidden="true" tabindex="-1"></a> <span class="co">#' P$hair</span></span> <span id="cb4-37"><a href="#cb4-37" aria-hidden="true" tabindex="-1"></a> <span class="at">set_hair =</span> <span class="cf">function</span>(val) {</span> <span id="cb4-38"><a href="#cb4-38" aria-hidden="true" tabindex="-1"></a> self<span class="sc">$</span>hair <span class="ot"><-</span> val</span> <span id="cb4-39"><a href="#cb4-39" aria-hidden="true" tabindex="-1"></a> },</span> <span id="cb4-40"><a href="#cb4-40" aria-hidden="true" tabindex="-1"></a></span> <span id="cb4-41"><a href="#cb4-41" aria-hidden="true" tabindex="-1"></a> <span class="co">#' @description</span></span> <span id="cb4-42"><a href="#cb4-42" aria-hidden="true" tabindex="-1"></a> <span class="co">#' Say hi.</span></span> <span id="cb4-43"><a href="#cb4-43" aria-hidden="true" tabindex="-1"></a> <span class="at">greet =</span> <span class="cf">function</span>() {</span> <span id="cb4-44"><a href="#cb4-44" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span>(<span class="fu">paste0</span>(<span class="st">"Hello, my name is "</span>, self<span class="sc">$</span>name, <span class="st">".</span><span class="sc">\n</span><span class="st">"</span>))</span> <span id="cb4-45"><a href="#cb4-45" aria-hidden="true" tabindex="-1"></a> }</span> <span id="cb4-46"><a href="#cb4-46" aria-hidden="true" tabindex="-1"></a> )</span> <span id="cb4-47"><a href="#cb4-47" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div> </div> <!-- code folding --> <!-- dynamically load mathjax for compatibility with self-contained --> <script> (function () { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; document.getElementsByTagName("head")[0].appendChild(script); })(); </script> </body> </html>