Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links, fix typos and Rmd structure #614

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions episodes/01-starting-with-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

We are studying inflammation in patients who have been given a new treatment for
arthritis, and need to analyze the first dozen data sets (here is a link to [download the data for this lesson](data/r-novice-inflammation-data.zip)).
The data sets are stored in [comma-separated values](../learners/reference.md#comma-separated-values-csv)
Expand Down Expand Up @@ -511,7 +508,7 @@ To support this, we can use the `apply` function.
## Getting Help

To learn about a function in R, e.g. `apply`, we can read its help
documention by running `help(apply)` or `?apply`.
documentation by running `help(apply)` or `?apply`.


::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down
5 changes: 1 addition & 4 deletions episodes/02-func-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

If we only had one data set to analyze, it would probably be faster to load the file into a spreadsheet and use that to plot some simple statistics.
But we have twelve files to check, and may have more in the future.
In this lesson, we'll learn how to write a function so that we can repeat several operations with a single command.
Expand Down Expand Up @@ -250,7 +247,7 @@ mySum <- function(input_1, input_2 = 10) {

2. Read the error message: `argument "input_1" is missing, with no default`
means that no value for `input_1` is provided in the function call,
and neither in the function's defintion. Thus, the addition in the
and neither in the function's definition. Thus, the addition in the
function body can not be completed.

:::::::::::::::::::::::::
Expand Down
3 changes: 0 additions & 3 deletions episodes/03-loops-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

We have created a function called `analyze` that creates graphs of the minimum, average, and maximum daily inflammation rates for a single data set:

```{r inflammation-01, fig.alt=c("Scatterplot of average daily inflammation over 40 days, increasing in a mostly straight line until day 20, and then decreasing in a mostly straight line to visualize inflammation levels in a single dataset.", "A scatterplot of maximum daily inflammation over 40 days, increasing in a straight line until day 20, and then decreasing in a straight line to visualize inflammation levels in a single dataset.", "A scatterplot of minimum daily inflammation over 40 days, increasing in a step-wise pattern until day 20, and then decreasing in a step-wise pattern to visualize inflammation levels in a single dataset.")}
Expand Down
3 changes: 0 additions & 3 deletions episodes/04-cond.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

Our previous lessons have shown us how to manipulate data, define our own functions, and repeat things.
However, the programs we have written so far always do the same things, regardless of what data they're given.
We want programs to make choices based on the values they are manipulating.
Expand Down
3 changes: 0 additions & 3 deletions episodes/05-cmdline.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

The R Console and other interactive tools like RStudio are great for prototyping code and exploring data, but sooner or later we will want to use our program in a pipeline or run it in a shell script to process thousands of data files.
In order to do that, we need to make our programs work like other Unix command-line tools.
For example, we may want a program that reads a data set and prints the average inflammation per patient:
Expand Down
3 changes: 0 additions & 3 deletions episodes/06-best-practices-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r source, include=FALSE}
```

### Keep track of who wrote your code and its intended purpose

Starting your code with an annotated description of what the code does when it is run will help you when you have to look at or change it in the future. Just one or two lines at the beginning of the file can save you or someone else a lot of time and effort when trying to understand what a particular script does.
Expand Down
3 changes: 0 additions & 3 deletions episodes/07-knitr-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

`knitr` is an R package that allows you to organize your notes, code, and results in a single document. It's a great tool for "literate programming" -- the idea that your code should be readable by humans as well as computers! It also keeps your writing and results together, so if you collect some new data or change how you clean the data, you just have to re-compile the document and you're up to date!

You write `knitr` documents in a simple plain text-like format called markdown, which allows you to format text using intuitive notation, so that you can focus on the content you're writing and generating a well-formatted document when needed. In fact, you can turn your plain text (and R code and results) into an HTML file or, if you have an installation of LaTeX and [Pandoc][pandoc] on your machine, a PDF, or even a Word document (if you must!).
Expand Down
5 changes: 1 addition & 4 deletions episodes/08-making-packages-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

Why should you make your own R packages?

**Reproducible research!**
Expand Down Expand Up @@ -233,7 +230,7 @@ kelvin_to_fahrenheit <- function(temp_K) {


[r-open-sci]: https://devguide.ropensci.org/building.html
[r-pkgs-desc]: https://r-pkgs.had.co.nz/description.html
[r-pkgs-desc]: https://r-pkgs.org/description.html
[devtools]: https://cran.r-project.org/package=devtools
[roxygen2]: https://cran.r-project.org/package=roxygen2

Expand Down
3 changes: 0 additions & 3 deletions episodes/09-supp-intro-rstudio.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

Let's start by learning about our tool.

- Point to the different panels: Console, Scripts, Environments, Plots.
Expand Down
3 changes: 0 additions & 3 deletions episodes/10-supp-addressing-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

R is a powerful language for data manipulation.
There are three main ways for addressing data inside R objects.

Expand Down
5 changes: 1 addition & 4 deletions episodes/11-supp-read-write-csv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

The most common way that scientists store data is in Excel spreadsheets.
While there are R packages designed to access data from Excel spreadsheets (e.g., gdata, RODBC, XLConnect, xlsx, RExcel),
users often find it easier to save their spreadsheets in [comma-separated values](reference.html#comma-separated-values-csv\) files \(CSV)
Expand Down Expand Up @@ -216,7 +213,7 @@ That's better!
It is common for data sets to have missing values, or mistakes.
The convention for recording missing values often depends on the individual who collected the data and can be recorded as `n.a.`, `--`, or empty cells " ".
R recognises the reserved character string `NA` as a missing value, but not some of the examples above.
Let's say the inflamation scale in the data set we used earlier `inflammation-01.csv` actually starts at `1` for no inflamation and the zero values (`0`) were a missed observation.
Let's say the inflammation scale in the data set we used earlier `inflammation-01.csv` actually starts at `1` for no inflammation and the zero values (`0`) were a missed observation.
Looking at the `?read.csv` help page is there an argument we could use to ensure all zeros (`0`) are read in as `NA`?
Perhaps, in the `car-speeds.csv` data contains mistakes and the person measuring the car speeds could not accurately distinguish between "Black or "Blue" cars.
Is there a way to specify more than one 'string', such as "Black" and "Blue", to be replaced by `NA`
Expand Down
3 changes: 0 additions & 3 deletions episodes/12-supp-factors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

Factors are used to represent categorical data. Factors can be ordered or
unordered and are an important class for statistical analysis and for plotting.

Expand Down
3 changes: 0 additions & 3 deletions episodes/13-supp-data-structures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

### Understanding Basic Data Types and Data Structures in R

To make the best of the R language, you'll need a strong understanding of the
Expand Down
7 changes: 2 additions & 5 deletions episodes/14-supp-call-stack.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

### The Call Stack

Let's take a closer look at what happens when we call `fahrenheit_to_kelvin(32)`.
Expand Down Expand Up @@ -140,8 +137,8 @@ result <- edges(highlight(inner_vec, outer_vec))


[man]: https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Environment-objects
[chapter]: https://adv-r.had.co.nz/Environments.html
[adv-r]: https://adv-r.had.co.nz/
[chapter]: https://adv-r.hadley.nz/environments.html
[adv-r]: https://adv-r.hadley.nz/index.html


:::::::::::::::::::::::::::::::::::::::: keypoints
Expand Down
3 changes: 0 additions & 3 deletions episodes/15-supp-loops-in-depth.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ source: Rmd

::::::::::::::::::::::::::::::::::::::::::::::::::

```{r, include=FALSE}
```

In R you have multiple options when repeating calculations: vectorized operations, `for` loops, and `apply` functions.

This lesson is an extension of [Analyzing Multiple Data Sets](03-loops-R.Rmd).
Expand Down
Loading