Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4d288db 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Oct 7, 2024
1 parent 60b9797 commit 8f90616
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ <h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#naming" id="toc-naming" class="nav-link active" data-scroll-target="#naming"><span class="header-section-number">3.1</span> Naming</a></li>
<li><a href="#anonymous-functions" id="toc-anonymous-functions" class="nav-link" data-scroll-target="#anonymous-functions"><span class="header-section-number">3.2</span> Anonymous functions</a></li>
<li><a href="#multi-line-function-defintions" id="toc-multi-line-function-defintions" class="nav-link" data-scroll-target="#multi-line-function-defintions"><span class="header-section-number">3.3</span> Multi-line function defintions</a></li>
<li><a href="#multi-line-function-definitions" id="toc-multi-line-function-definitions" class="nav-link" data-scroll-target="#multi-line-function-definitions"><span class="header-section-number">3.3</span> Multi-line function definitions</a></li>
<li><a href="#s7" id="toc-s7" class="nav-link" data-scroll-target="#s7"><span class="header-section-number">3.4</span> S7</a></li>
<li><a href="#return" id="toc-return" class="nav-link" data-scroll-target="#return"><span class="header-section-number">3.5</span> <code>return()</code></a></li>
<li><a href="#comments" id="toc-comments" class="nav-link" data-scroll-target="#comments"><span class="header-section-number">3.6</span> Comments</a></li>
Expand Down Expand Up @@ -332,8 +332,8 @@ <h2 data-number="3.2" class="anchored" data-anchor-id="anonymous-functions"><spa
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a>cv <span class="ot">&lt;-</span> \(x) <span class="fu">sd</span>(x) <span class="sc">/</span> <span class="fu">mean</span>(x)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Avoid using <code>\()</code> in a pipe, and remember to use informative argument names.</p>
</section>
<section id="multi-line-function-defintions" class="level2" data-number="3.3">
<h2 data-number="3.3" class="anchored" data-anchor-id="multi-line-function-defintions"><span class="header-section-number">3.3</span> Multi-line function defintions</h2>
<section id="multi-line-function-definitions" class="level2" data-number="3.3">
<h2 data-number="3.3" class="anchored" data-anchor-id="multi-line-function-definitions"><span class="header-section-number">3.3</span> Multi-line function definitions</h2>
<p>There are two options if the function name and definition can’t fit on a single line. In both cases, each argument goes on its own line; the difference is how deep you indent it and where you put <code>)</code> and <code>{</code>:</p>
<ul>
<li><p><strong>Single-indent</strong>: indent the argument name with a single indent (i.e.&nbsp;two spaces). The trailing <code>)</code> and leading <code>{</code> go on a new line.</p>
Expand Down
8 changes: 4 additions & 4 deletions search.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@
]
},
{
"objectID": "functions.html#multi-line-function-defintions",
"href": "functions.html#multi-line-function-defintions",
"objectID": "functions.html#multi-line-function-definitions",
"href": "functions.html#multi-line-function-definitions",
"title": "3  Functions",
"section": "3.3 Multi-line function defintions",
"text": "3.3 Multi-line function defintions\nThere are two options if the function name and definition can’t fit on a single line. In both cases, each argument goes on its own line; the difference is how deep you indent it and where you put ) and {:\n\nSingle-indent: indent the argument name with a single indent (i.e. two spaces). The trailing ) and leading { go on a new line.\n\n# Good\nlong_function_name &lt;- function(\n a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\"\n) {\n # As usual code is indented by two spaces.\n}\n\nHanging-indent: indent the argument name to match the opening ( of function. The trailing ) and leading { go on the same line as the last argument.\n\n# Good\nlong_function_name &lt;- function(a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\") {\n # As usual code is indented by two spaces.\n}\n\n\nThese styles are designed to clearly separate the function definition from its body.\n\n# Bad\nlong_function_name &lt;- function(a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\") {\n # Here it's hard to spot where the definition ends and the\n # code begins, and to see all three function arguments\n}\n\nIf a function argument can’t fit on a single line, this is a sign you should rework the argument to keep it short and sweet.",
"section": "3.3 Multi-line function definitions",
"text": "3.3 Multi-line function definitions\nThere are two options if the function name and definition can’t fit on a single line. In both cases, each argument goes on its own line; the difference is how deep you indent it and where you put ) and {:\n\nSingle-indent: indent the argument name with a single indent (i.e. two spaces). The trailing ) and leading { go on a new line.\n\n# Good\nlong_function_name &lt;- function(\n a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\"\n) {\n # As usual code is indented by two spaces.\n}\n\nHanging-indent: indent the argument name to match the opening ( of function. The trailing ) and leading { go on the same line as the last argument.\n\n# Good\nlong_function_name &lt;- function(a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\") {\n # As usual code is indented by two spaces.\n}\n\n\nThese styles are designed to clearly separate the function definition from its body.\n\n# Bad\nlong_function_name &lt;- function(a = \"a long argument\",\n b = \"another argument\",\n c = \"another long argument\") {\n # Here it's hard to spot where the definition ends and the\n # code begins, and to see all three function arguments\n}\n\nIf a function argument can’t fit on a single line, this is a sign you should rework the argument to keep it short and sweet.",
"crumbs": [
"Analyses",
"<span class='chapter-number'>3</span>  <span class='chapter-title'>Functions</span>"
Expand Down
24 changes: 12 additions & 12 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://style.tidyverse.org/index.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/files.html</loc>
<lastmod>2024-10-02T17:45:02.766Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/syntax.html</loc>
<lastmod>2024-10-02T17:45:02.768Z</lastmod>
<lastmod>2024-10-07T05:35:24.004Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/functions.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/pipes.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/ggplot2.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/package-files.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/documentation.html</loc>
<lastmod>2024-10-02T17:45:02.766Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/tests.html</loc>
<lastmod>2024-10-02T17:45:02.768Z</lastmod>
<lastmod>2024-10-07T05:35:24.004Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/errors.html</loc>
<lastmod>2024-10-02T17:45:02.766Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/news.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
<url>
<loc>https://style.tidyverse.org/git.html</loc>
<lastmod>2024-10-02T17:45:02.767Z</lastmod>
<lastmod>2024-10-07T05:35:24.003Z</lastmod>
</url>
</urlset>

0 comments on commit 8f90616

Please sign in to comment.