From 7495c114c2c25dbc064dd6de5b0e968c6b7a15ba Mon Sep 17 00:00:00 2001 From: semacu Date: Wed, 23 May 2018 00:07:07 +0100 Subject: [PATCH] Typos and comments --- 01-intro-to-R.Rmd | 15 +++++---------- 02-starting-with-data.Rmd | 5 +++-- 04-dplyr.Rmd | 5 +---- 05-data-visualization.Rmd | 11 +++++------ index.Rmd | 6 ++---- 5 files changed, 16 insertions(+), 26 deletions(-) diff --git a/01-intro-to-R.Rmd b/01-intro-to-R.Rmd index 2f46095..03fd539 100644 --- a/01-intro-to-R.Rmd +++ b/01-intro-to-R.Rmd @@ -15,7 +15,7 @@ knitr::opts_chunk$set(results='hide', fig.path='img/r-lesson-') > > * Assign names to objects in R with <- and =. > * Solve mathematical operations in R. -> * Describe what a function is in R. +> * Describe what a function in R is. > * Describe what vectors are and how they can be manipulated in R. > * Inspect the content of vectors in R and describe their content with class and str. @@ -66,10 +66,8 @@ doesn't work. Now we're stuck over in the console. The `+` sign means that it's still waiting for input, so we can't type in a new command. To get out of this press the `Esc` key. This will work whenever you're stuck with that `+` sign. -It's great that R is a glorified caluculator, but obviously -we want to do more interesting things. - -To do useful and interesting things, we need to assign _values_ to +It's great that R is a glorified calculator, but obviously +we want to do more interesting things, e.g. we can assign _values_ to _objects_. To create objects, we need to give it a name followed by the assignment operator `<-` and the value we want to give it. @@ -97,10 +95,8 @@ be read as 3 **goes into** `x`. You can also use `=` or `->`for assignments but all contexts so it is good practice to use `<-` for assignments. `=` should only be used to specify the values of arguments in functions, see below. -In RStudio, typing Alt + - (push Alt at the - -same time as the - key) will write ` <- ` in a single keystroke - in a PC, while typing Option + - (push Option at the - +same time as the - key) does the same in a Mac. +In RStudio, typing Alt + - (push Alt at the same time as the - key) will write ` <- ` in a single keystroke + in a PC, while typing Option + - (push Option at the same time as the - key) does the same in a Mac. ### Exercise @@ -510,4 +506,3 @@ sessionInfo() mailing lists. * [How to ask for R help](http://blog.revolutionanalytics.com/2014/01/how-to-ask-for-r-help.html) useful guidelines - diff --git a/02-starting-with-data.Rmd b/02-starting-with-data.Rmd index fa734a4..c887818 100644 --- a/02-starting-with-data.Rmd +++ b/02-starting-with-data.Rmd @@ -73,7 +73,8 @@ Wow... that was a lot of output. At least it means the data loaded properly. Let head(metadata) ``` -We've just done two very useful things. +We've just done two very useful things: + 1. We've read our data in to R, so now we can work with it in R 2. We've created a data frame (with the read.csv command) the standard way R works with data. @@ -172,7 +173,7 @@ When we read in a file, any column that contains text is automatically assumed to be a factor. Once created, factors can only contain a pre-defined set values, known as *levels*. By default, R always sorts *levels* in alphabetical order. -For instance, we see that `cit` is a Factor w/ 3 levels, `minus`, `plus` and `unknown`. +For instance, we see that `cit` is a Factor w/ 3 levels, `minus`, `plus` and `unknown`. The vector `3 3 3 3 3 3 ... ` indicates that the first samples have `unknown` (third level) citrate status.