Skip to content

Commit

Permalink
Merge pull request #274 from naupaka/main
Browse files Browse the repository at this point in the history
Some minor clean up (style/spacing, remove unneeded chunk, etc)
  • Loading branch information
JasonJWilliamsNY authored Oct 2, 2024
2 parents e09d9e7 + 0899b57 commit a3a27da
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions episodes/01-r-basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ source: Rmd

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

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

## "The fantastic world of R awaits you" OR "Nobody wants to learn how to use R"

Before we begin this lesson, we want you to be clear on the goal of the workshop
Expand Down Expand Up @@ -219,7 +216,7 @@ but R is "not sure"
about how to assign the name to "human\_ chr\_number" when the object name we
want is "human\_chr\_number".

<img src="fig/rstudio_script_warning.png" alt="rstudio script warning" style="width: 600px;"/>
![RStudio script warning]("fig/rstudio_script_warning.png")

Check warning on line 219 in episodes/01-r-basics.Rmd

View workflow job for this annotation

GitHub Actions / Build Full Site

[image missing alt-text]: "fig/rstudio_script_warning.png"

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

Expand Down Expand Up @@ -429,7 +426,7 @@ can be added, multiplied, divided, etc. R provides several mathematical
These can be used with literal numbers:

```{r, purl=FALSE}
(1 + (5 ** 0.5))/2
(1 + (5 ** 0.5)) / 2
```

and importantly, can be used on any object that evaluates to (i.e. interpreted
Expand Down Expand Up @@ -459,7 +456,7 @@ functions. Hint: remember the `round()` function can take 2 arguments.
## Solution

```{r, purl=FALSE}
round((1 + sqrt(5))/2, digits = 3)
round((1 + sqrt(5)) / 2, digits = 3)
```

Notice that you can place one function inside of another.
Expand Down Expand Up @@ -554,7 +551,7 @@ Also, several of these subsetting expressions can be combined:
```{r, purl=FALSE}
# get the 1st through the 3rd value, and 4th value in the snp vector
# yes, this is a little silly in a vector of only 4 values.
snps[c(1:3,4)]
snps[c(1:3, 4)]
```

## Adding to, removing, or replacing values in existing vectors
Expand Down Expand Up @@ -591,7 +588,7 @@ snp_genes
We can also explicitly rename or add a value to our index using double bracket notation:

```{r, purl=FALSE}
snp_genes[6]<- "APOA5"
snp_genes[6] <- "APOA5"
snp_genes
```

Expand Down

0 comments on commit a3a27da

Please sign in to comment.