@@ -23,9 +23,6 @@ source: Rmd
23
23
24
24
::::::::::::::::::::::::::::::::::::::::::::::::::
25
25
26
- ``` {r, include=FALSE}
27
- ```
28
-
29
26
## "The fantastic world of R awaits you" OR "Nobody wants to learn how to use R"
30
27
31
28
Before we begin this lesson, we want you to be clear on the goal of the workshop
@@ -219,7 +216,7 @@ but R is "not sure"
219
216
about how to assign the name to "human\_ chr\_ number" when the object name we
220
217
want is "human\_ chr\_ number".
221
218
222
- < img src = " fig/rstudio_script_warning.png " alt = " rstudio script warning " style = " width : 600 px ; " />
219
+ ![ RStudio script warning ] ( "fig/rstudio_script_warning.png" )
223
220
224
221
::::::::::::::::::::::::::::::::::::::::::::::::::
225
222
@@ -429,7 +426,7 @@ can be added, multiplied, divided, etc. R provides several mathematical
429
426
These can be used with literal numbers:
430
427
431
428
``` {r, purl=FALSE}
432
- (1 + (5 ** 0.5))/ 2
429
+ (1 + (5 ** 0.5)) / 2
433
430
```
434
431
435
432
and importantly, can be used on any object that evaluates to (i.e. interpreted
@@ -459,7 +456,7 @@ functions. Hint: remember the `round()` function can take 2 arguments.
459
456
## Solution
460
457
461
458
``` {r, purl=FALSE}
462
- round((1 + sqrt(5))/ 2, digits = 3)
459
+ round((1 + sqrt(5)) / 2, digits = 3)
463
460
```
464
461
465
462
Notice that you can place one function inside of another.
@@ -554,7 +551,7 @@ Also, several of these subsetting expressions can be combined:
554
551
``` {r, purl=FALSE}
555
552
# get the 1st through the 3rd value, and 4th value in the snp vector
556
553
# yes, this is a little silly in a vector of only 4 values.
557
- snps[c(1:3,4)]
554
+ snps[c(1:3, 4)]
558
555
```
559
556
560
557
## Adding to, removing, or replacing values in existing vectors
@@ -591,7 +588,7 @@ snp_genes
591
588
We can also explicitly rename or add a value to our index using double bracket notation:
592
589
593
590
``` {r, purl=FALSE}
594
- snp_genes[6]<- "APOA5"
591
+ snp_genes[6] <- "APOA5"
595
592
snp_genes
596
593
```
597
594
0 commit comments