Fix code language
This commit is contained in:
		@@ -92,12 +92,12 @@ The tidyverse</h2>
 | 
			
		||||
<p>You’ll also need to install some R packages. An R <strong>package</strong> is a collection of functions, data, and documentation that extends the capabilities of base R. Using packages is key to the successful use of R. The majority of the packages that you will learn in this book are part of the so-called tidyverse. All packages in the tidyverse share a common philosophy of data and R programming, and are designed to work together naturally.</p>
 | 
			
		||||
<p>You can install the complete tidyverse with a single line of code:</p>
 | 
			
		||||
<div class="cell">
 | 
			
		||||
<pre data-type="programlisting" data-code-language="downlit">install.packages("tidyverse")</pre>
 | 
			
		||||
<pre data-type="programlisting" data-code-language="r">install.packages("tidyverse")</pre>
 | 
			
		||||
</div>
 | 
			
		||||
<p>On your own computer, type that line of code in the console, and then press enter to run it. R will download the packages from CRAN and install them on to your computer. If you have problems installing, make sure that you are connected to the internet, and that <a href="https://cloud.r-project.org/" class="uri">https://cloud.r-project.org/</a> isn’t blocked by your firewall or proxy.</p>
 | 
			
		||||
<p>You will not be able to use the functions, objects, or help files in a package until you load it with <code><a href="https://rdrr.io/r/base/library.html">library()</a></code>. Once you have installed a package, you can load it using the <code><a href="https://rdrr.io/r/base/library.html">library()</a></code> function:</p>
 | 
			
		||||
<div class="cell">
 | 
			
		||||
<pre data-type="programlisting" data-code-language="downlit">library(tidyverse)
 | 
			
		||||
<pre data-type="programlisting" data-code-language="r">library(tidyverse)
 | 
			
		||||
#> ── Attaching packages ──────────────────────────────────── tidyverse 1.3.2 ──
 | 
			
		||||
#> ✔ ggplot2 3.4.0.9000        ✔ purrr   0.9000.0.9000
 | 
			
		||||
#> ✔ tibble  3.1.8             ✔ dplyr   1.0.99.9000  
 | 
			
		||||
@@ -117,7 +117,7 @@ Other packages</h2>
 | 
			
		||||
<p>There are many other excellent packages that are not part of the tidyverse, because they solve problems in a different domain, or are designed with a different set of underlying principles. This doesn’t make them better or worse, just different. In other words, the complement to the tidyverse is not the messyverse, but many other universes of interrelated packages. As you tackle more data science projects with R, you’ll learn new packages and new ways of thinking about data.</p>
 | 
			
		||||
<p>In this book we’ll use three data packages from outside the tidyverse:</p>
 | 
			
		||||
<div class="cell">
 | 
			
		||||
<pre data-type="programlisting" data-code-language="downlit">install.packages(c("nycflights13", "gapminder", "Lahman"))</pre>
 | 
			
		||||
<pre data-type="programlisting" data-code-language="r">install.packages(c("nycflights13", "gapminder", "Lahman"))</pre>
 | 
			
		||||
</div>
 | 
			
		||||
<p>These packages provide data on airline flights, world development, and baseball that we’ll use to illustrate key data science ideas.</p>
 | 
			
		||||
</section>
 | 
			
		||||
@@ -128,7 +128,7 @@ Other packages</h2>
 | 
			
		||||
Running R code</h1>
 | 
			
		||||
<p>The previous section showed you several examples of running R code. Code in the book looks like this:</p>
 | 
			
		||||
<div class="cell">
 | 
			
		||||
<pre data-type="programlisting" data-code-language="downlit">1 + 2
 | 
			
		||||
<pre data-type="programlisting" data-code-language="r">1 + 2
 | 
			
		||||
#> [1] 3</pre>
 | 
			
		||||
</div>
 | 
			
		||||
<p>If you run the same code in your local console, it will look like this:</p>
 | 
			
		||||
@@ -258,7 +258,7 @@ Colophon</h1>
 | 
			
		||||
<td style="text-align: left;">CRAN (R 4.2.0)</td>
 | 
			
		||||
</tr></tbody></table></div>
 | 
			
		||||
<div class="cell">
 | 
			
		||||
<pre data-type="programlisting" data-code-language="downlit">cli:::ruler()
 | 
			
		||||
<pre data-type="programlisting" data-code-language="r">cli:::ruler()
 | 
			
		||||
#> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+--
 | 
			
		||||
#> 12345678901234567890123456789012345678901234567890123456789012345678901234567</pre>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user