Fix code language

This commit is contained in:
Hadley Wickham
2022-11-18 11:26:25 -06:00
parent 69b4597f3b
commit 868a35ca71
29 changed files with 912 additions and 907 deletions

View File

@@ -18,11 +18,11 @@ Making a reprex</h1>
<li><p>The other 20% of time you will have captured the essence of your problem in a way that is easy for others to play with. This substantially improves your chances of getting help!</p></li>
</ul><p>When creating a reprex by hand, its easy to accidentally miss something that means your code cant be run on someone elses computer. Avoid this problem by using the reprex package which is installed as part of the tidyverse. Lets say you copy this code onto your clipboard (or, on RStudio Server or Cloud, select it):</p>
<div class="cell">
<pre data-type="programlisting" data-code-language="downlit">y &lt;- 1:4
<pre data-type="programlisting" data-code-language="r">y &lt;- 1:4
mean(y)</pre>
</div>
<p>Then call <code>reprex()</code>, where the default target venue is GitHub:</p>
<pre data-type="programlisting" data-code-language="downlit">reprex::reprex()</pre>
<pre data-type="programlisting" data-code-language="r">reprex::reprex()</pre>
<p>A nicely rendered HTML preview will display in RStudios Viewer (if youre in RStudio) or your default browser otherwise. The relevant bit of GitHub-flavored Markdown is ready to be pasted from your clipboard (on RStudio Server or Cloud, you will need to copy this yourself):</p>
<pre><code>``` r
y &lt;- 1:4
@@ -31,7 +31,7 @@ mean(y)
```</code></pre>
<p>Heres what that Markdown would look like rendered in a GitHub issue:</p>
<div class="cell">
<pre data-type="programlisting" data-code-language="downlit">y &lt;- 1:4
<pre data-type="programlisting" data-code-language="r">y &lt;- 1:4
mean(y)
#&gt; [1] 2.5</pre>
</div>