Fix figure manipulation

This commit is contained in:
Hadley Wickham
2022-11-18 10:42:43 -06:00
parent 78a1c12fe7
commit 89a854b7d0
15 changed files with 114 additions and 115 deletions

View File

@@ -10,8 +10,8 @@
<p>Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread. Even as a very new programmer its a good idea to work on your code style. Using a consistent style makes it easier for others (including future-you!) to read your work, and is particularly important if you need to get help from someone else. This chapter will introduce to the most important points of the <a href="https://style.tidyverse.org">tidyverse style guide</a>, which is used throughout this book.</p><p>Styling your code will feel a bit tedious to start with, but if you practice it, it will soon become second nature. Additionally, there are some great tools to quickly restyle existing code, like the <a href="https://styler.r-lib.org">styler</a> package by Lorenz Walthert. Once youve installed it with <code>install.packages("styler")</code>, an easy way to use it is via RStudios <strong>command palette</strong>. The command palette lets you use any build-in RStudio command, as well as many addins provided by packages. Open the palette by pressing Cmd/Ctrl + Shift + P, then type “styler” to see all the shortcuts provided by styler. <a href="#fig-styler" data-type="xref">#fig-styler</a> shows the results.</p><div class="cell">
<div class="cell-output-display">
<figure id="fig-rstudio-sections"><p><img src="screenshots/rstudio-palette.png" alt="A screenshot showing the command palette after typing &quot;styler&quot;, showing the four styling tool provided by the package." width="638"/></p>
<figcaption>Figure 7.1: RStudios command palette makes it easy to access every RStudio command using only the keyboard.</figcaption>
<figure id="fig-styler"><p><img src="screenshots/rstudio-palette.png" alt="A screenshot showing the command palette after typing &quot;styler&quot;, showing the four styling tool provided by the package." width="638"/></p>
<figcaption>RStudios command palette makes it easy to access every RStudio command using only the keyboard.</figcaption>
</figure>
</div>
</div><div class="cell">
@@ -180,8 +180,8 @@ Sectioning comments</h1>
<div class="cell">
<div class="cell-output-display">
<figure class="figure"><p><img src="screenshots/rstudio-nav.png" width="125"/></p>
<figcaption class="figure-caption">Figure 7.2: After adding sectioning comments to your script, you can easily navigate to them using the code navigation tool in the bottom-left of the script editor.</figcaption>
<figure id="fig-rstudio-sections"><p><img src="screenshots/rstudio-nav.png" width="125"/></p>
<figcaption>After adding sectioning comments to your script, you can easily navigate to them using the code navigation tool in the bottom-left of the script editor.</figcaption>
</figure>
</div>
</div>