diff --git a/episodes/01-r-basics.Rmd b/episodes/01-r-basics.Rmd index 1f7c9378..d3d4ed99 100644 --- a/episodes/01-r-basics.Rmd +++ b/episodes/01-r-basics.Rmd @@ -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 @@ -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". -rstudio script warning +![RStudio script warning]("fig/rstudio_script_warning.png") :::::::::::::::::::::::::::::::::::::::::::::::::: @@ -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 @@ -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. @@ -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 @@ -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 ```