Fix code language
This commit is contained in:
@@ -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, it’s easy to accidentally miss something that means your code can’t be run on someone else’s computer. Avoid this problem by using the reprex package which is installed as part of the tidyverse. Let’s 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 <- 1:4
|
||||
<pre data-type="programlisting" data-code-language="r">y <- 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 RStudio’s Viewer (if you’re 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 <- 1:4
|
||||
@@ -31,7 +31,7 @@ mean(y)
|
||||
```</code></pre>
|
||||
<p>Here’s what that Markdown would look like rendered in a GitHub issue:</p>
|
||||
<div class="cell">
|
||||
<pre data-type="programlisting" data-code-language="downlit">y <- 1:4
|
||||
<pre data-type="programlisting" data-code-language="r">y <- 1:4
|
||||
mean(y)
|
||||
#> [1] 2.5</pre>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user