Skip to content

Commit

Permalink
Final update to GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
arranhamlet committed Oct 14, 2024
2 parents 0db3e99 + a53d14a commit fca5341
Show file tree
Hide file tree
Showing 237 changed files with 3,357 additions and 42,545 deletions.
2 changes: 1 addition & 1 deletion .Rhistory
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
############
learnr, # interactive tutorials in RStudio Tutorial pane
swirl, # interactive tutorials in R console
# project and file management
Expand Down Expand Up @@ -510,3 +509,4 @@ bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_bookdown.yml")
renv::status()
here("data", "linelists", "linelist_raw.xlsx")
2 changes: 1 addition & 1 deletion html_outputs/new_pages/gis.html
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ <h2 data-number="28.12" class="anchored" data-anchor-id="resources"><span class=
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","selector":".lightbox","descPosition":"bottom","loop":false,"closeEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","closeEffect":"zoom","openEffect":"zoom","descPosition":"bottom","loop":false});
(function() {
let previousOnload = window.onload;
window.onload = () => {
Expand Down
6 changes: 3 additions & 3 deletions html_outputs/new_pages/quarto.html
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ <h1 class="title"><span class="chapter-number">44</span>&nbsp; <span class="chap
</div>
</div>
</div>
<p>Quarto is an alternative approach to R Markdown for creating automated, reproducible reports, presentations and interactive dashboards. Quarto was developed by the team behind R Studio, to take the functionality of R Markdown, with other approaches, and combine them into a single consistent system.</p>
<p>Quarto is an alternative approach to R Markdown for creating automated, reproducible reports, presentations and interactive dashboards. Quarto was developed by the team behind RStudio, to take the functionality of R Markdown, with other approaches, and combine them into a single consistent system.</p>
<p>As the overall philosophy and syntax of Quarto is nearly identical to that of R Markdown, this chapter will not focus on these, and instead refer you to the <a href="../new_pages/rmarkdown.html">R Markdown chapter</a> for instructions on syntax and application. We will approach the following topics:</p>
<ol type="1">
<li>Why Quarto over R Markdown?</li>
Expand Down Expand Up @@ -798,7 +798,7 @@ <h2 data-number="44.2" class="anchored" data-anchor-id="getting-started"><span c
</div>
<p>This will create your new Quarto script. <em>Note: While the R Markdown scripts ended with .Rmd, Quarto scripts end with .qmd</em></p>
<p>While R Markdown scripts set the working directory to wherever the file is located, Quarto documents retain the original working directory. This is especially useful when you are working with an <a href="../new_pages/r_projects.html">R Project</a>.</p>
<p>Your first view of the Quarto document may look different to what you are use to with an R Markdown document. This is because Quarto has the additional functionality of allow you to see what the rendered document will look like after it has been knit. To switch between the “Visual” and “Source” mode (which is what you see when you create an R Markdown document), click the “Visual” button in the top left side of the script.</p>
<p>Like for R Markdown, Quarto used in RStudio allows you to see what the rendered document will look like after it has been knit. To switch between the “Visual” and “Source” mode, click the “Visual” button in the top left side of the script.</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
Expand Down Expand Up @@ -1436,7 +1436,7 @@ <h2 data-number="44.4" class="anchored" data-anchor-id="resources"><span class="
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"closeEffect":"zoom","openEffect":"zoom","descPosition":"bottom","selector":".lightbox","loop":false});
<script>var lightboxQuarto = GLightbox({"loop":false,"descPosition":"bottom","openEffect":"zoom","selector":".lightbox","closeEffect":"zoom"});
(function() {
let previousOnload = window.onload;
window.onload = () => {
Expand Down
2 changes: 1 addition & 1 deletion html_outputs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -4608,7 +4608,7 @@
"href": "new_pages/quarto.html#getting-started",
"title": "44  Quarto",
"section": "44.2 Getting started",
"text": "44.2 Getting started\nCreating a Quarto document does not require us to download an additional package, unlike R Markdown which requires the rmarkdown package. Additionally, you do not need to install LaTex, as you do with R Markdown, as Quarto contains built in functionality.\nFunctionally, Quarto works the same way as R Markdown. You create your Quarto script (instead of your R Markdown file), write your code, and knit the document.\nFirst, just like when you create an R Markdown document in Rstudio you start with File, then New file, then R Markdown.\n\n\n\n\n\n\n\n\n\nYou will then get a number of different options to choose. Here we will select “HTML” to create an html document. All these details can be changed later in the document, so do not worry if you change your mind later.\n\n\n\n\n\n\n\n\n\nThis will create your new Quarto script. Note: While the R Markdown scripts ended with .Rmd, Quarto scripts end with .qmd\nWhile R Markdown scripts set the working directory to wherever the file is located, Quarto documents retain the original working directory. This is especially useful when you are working with an R Project.\nYour first view of the Quarto document may look different to what you are use to with an R Markdown document. This is because Quarto has the additional functionality of allow you to see what the rendered document will look like after it has been knit. To switch between the “Visual” and “Source” mode (which is what you see when you create an R Markdown document), click the “Visual” button in the top left side of the script.\n\n\n\n\n\n\n\n\n\nYou are now ready to code your Quarto script! The syntax and approach is the same as creating an R Markdown document, so see the chapter on Reports with R Markdown for guidance and inspiration.\nHere is an example of what a Quarto script for analysing our linelist data set might look like.\n\n\n\n\n\n\n\n\n\nAnd here is what the output looks like.",
"text": "44.2 Getting started\nCreating a Quarto document does not require us to download an additional package, unlike R Markdown which requires the rmarkdown package. Additionally, you do not need to install LaTex, as you do with R Markdown, as Quarto contains built in functionality.\nFunctionally, Quarto works the same way as R Markdown. You create your Quarto script (instead of your R Markdown file), write your code, and knit the document.\nFirst, just like when you create an R Markdown document in Rstudio you start with File, then New file, then R Markdown.\n\n\n\n\n\n\n\n\n\nYou will then get a number of different options to choose. Here we will select “HTML” to create an html document. All these details can be changed later in the document, so do not worry if you change your mind later.\n\n\n\n\n\n\n\n\n\nThis will create your new Quarto script. Note: While the R Markdown scripts ended with .Rmd, Quarto scripts end with .qmd\nWhile R Markdown scripts set the working directory to wherever the file is located, Quarto documents retain the original working directory. This is especially useful when you are working with an R Project.\nLike for R Markdown, Quarto used in RStudio allows you to see what the rendered document will look like after it has been knit. To switch between the “Visual” and “Source” mode, click the “Visual” button in the top left side of the script.\n\n\n\n\n\n\n\n\n\nYou are now ready to code your Quarto script! The syntax and approach is the same as creating an R Markdown document, so see the chapter on Reports with R Markdown for guidance and inspiration.\nHere is an example of what a Quarto script for analysing our linelist data set might look like.\n\n\n\n\n\n\n\n\n\nAnd here is what the output looks like.",
"crumbs": [
"Reports and dashboards",
"<span class='chapter-number'>44</span>  <span class='chapter-title'>Quarto</span>"
Expand Down
8 changes: 4 additions & 4 deletions new_pages/basics.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ On installation, R contains **"base"** packages and functions that perform commo

*Functions* are contained within **packages** which can be downloaded ("installed") to your computer from the internet. Once a package is downloaded, it is stored in your "library". You can then access the functions it contains during your current R session by "loading" the package.

*Think of R as your personal library*: When you download a package, your library gains a new book of functions, but each time you want to use a function in that book, you must borrow,"load", that book from your library.
*Think of R as your personal library*: When you download a package, your library gains a new book of functions, but each time you want to use a function in that book, you must borrow, "load", that book from your library.

In summary: to use the functions available in an R package, 2 steps must be implemented:

Expand Down Expand Up @@ -528,7 +528,7 @@ library(rio)
library(here)
```

To check whether a package in installed or loaded, you can view the Packages pane in RStudio. If the package is installed, it is shown there with version number. If its box is checked, it is loaded for the current session.
To check whether a package is installed or loaded, you can view the Packages pane in RStudio. If the package is installed, it is shown there with version number. If its box is checked, it is loaded for the current session.

**Install from Github**

Expand Down Expand Up @@ -1015,7 +1015,7 @@ class(linelist$gender) # class should be character
Sometimes, a column will be converted to a different class automatically by R. Watch out for this! For example, if you have a vector or column of numbers, but a character value is inserted... the entire column will change to class character.

```{r}
num_vector <- c(1, 2 , 3, 4, 5) # define vector as all numbers
num_vector <- c(1, 2, 3, 4, 5) # define vector as all numbers
class(num_vector) # vector is numeric class
num_vector[3] <- "three" # convert the third element to a character
class(num_vector) # vector is now character class
Expand Down Expand Up @@ -1233,7 +1233,7 @@ You can think of it as saying "and then". Many functions can be linked together
Pipe operators were first introduced through the [magrittr package](https://magrittr.tidyverse.org/), which is part of tidyverse, and were specified as `%>%`. In R 4.1.0, they introduced a **base** R pipe which is specified through `|>`. The behaviour of the two pipes is the same, and they can be used somewhat interchangeably. However, there are a few key differences.

* The `%>%` pipe allows you to pass multiple arguments.
* The `%>%` pipe lets you drop parenthesis when calling a function with no other arguments (i.e. drop vs drop()).
* The `%>%` pipe lets you drop parentheses when calling a function with no other arguments (i.e. `drop` vs `drop()`).
* The `%>%` pipe allows you to start a pipe with `.` to create a function in your linking of code.

For these reasons, we recommend the **magrittr** pipe, `%>%`, over the **base** R pipe, `|>`.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fca5341

Please sign in to comment.