From 1bc875527cca571fc2853dee5ed852f98bd5ed12 Mon Sep 17 00:00:00 2001 From: Stephan Koenig Date: Sat, 30 May 2020 16:56:49 -0700 Subject: [PATCH 01/20] Move file from master to individual branch --- .../r_and_rstudio_basic.Rmd | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd new file mode 100644 index 0000000..8e5fb6c --- /dev/null +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -0,0 +1,294 @@ +--- +title: "Introduction to R and RStudio fundamentals" +author: "Michelle Kang (adapted from Dr. Kim Dill-McFarland)" +date: "version `r format(Sys.time(), '%B %d, %Y')`" +output: + learnr::tutorial: + progressive: true + allow_skip: true +runtime: shiny_prerendered +description: In-depth description will follow. +--- + +```{r setup, include = FALSE} +# General learnr setup +library(learnr) +knitr::opts_chunk$set(echo = TRUE) +library(educer) +# Helper function to set path to images to "/images" etc. +setup_resources() + +# Tutorial specific setup +library(dplyr) +library(readr) +``` + +## Learning objectives + +By the end of this tutorial you should be able to: + +- Identify the different components of RStudio. +- Declare variables in R. +- Recognize and use functions. +- Install and load R packages. +- Load and subset tabular data using tidyverse. +- Use the `help` function in R console to troubleshoot given a new function. + + + +## A Tour of RStudio + +When you start RStudio, you will see something like the following window appear: + +![](/images/rstudio.png){width=100%} + +Notice that the window has three "panes": + +- Console (lower left side): this is your view of the R engine. You can type in R commands here and see the output printed by R. (To tell them apart, your input is in blue, and the output is black.) There are several editing conveniences available: use up and down arrow keys to go back to previously entered commands, which you then can edit and re-run; TAB for completing the name before the cursor; see more in [online docs](http://www.rstudio.com/ide/docs/using/keyboard_shortcuts). + +- Environment/History (tabbed in the upper right): view current user-defined objects and previously-entered commands, respectively. + +- Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages. + +To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan to be working for longer periods, we suggest choosing a dark background colour scheme to save your computer battery and your eyes. + + + +## RStudio Projects + +Projects are a great feature of RStudio. When you create a project, RStudio creates an ".Rproj" file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer like "/Users/username/Desktop/". R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in ".RData" so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. + +RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labelled "Project: (None)", initially.) + +Let's create a project to work in for this tutorial. Start by clicking the "Project" button in the upper right or going to the "File" menu. Select "New Project", and the following will appear: + +![](/images/create_project.png){width=75%} + + +Choose "New Directory" followed by "New Project" and click on "Browse...". Navigate to your Desktop, and name the directory "\ R"(replace \ with the name of your class, e.g. "MICB301") for this project. + +After your project is created, navigate to its directory using your Finder/File explorer or the integrated Terminal in RStudio. You will see the ".RProj" file has been created. + +You can open this project in the future in one of three ways: + +- In your Finder/file browser, simply double-click on the ".RProj" file +- In an open RStudio window, choose "File" → "Open Project" +- Switch among projects by clicking on the R project symbol in the upper left +corner of RStudio + + + +## Variables in R + +We use variables to store data that we want to access or manipulate later. Variables must have unique names. + +Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use: + +```{r} +2 + 2 +``` + +To declare a variable, follow the pattern of: `variable <- value`. Let's declare a variable `total` as the sum of two numbers. + +```{r} +total <- 2 + 2 +``` + +We access the value of `total`: + +```{r} +total +``` + +We can use the value stored in `total`: + +```{r} +total - 1 +``` + +After declaring a variable, we can perform operations to change the value stored in the variable: + +```{r} +total <- total - 1 +``` + +Now `total` stores a new value: + +```{r} +total +``` + + + +## Functions + +Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): + +`function(argument1 = ..., argument2 = ..., ...)` + +You can treat functions as a black box and do not necessarily need to know how it works under the hood as long as your provided input conforms to a specific shape. + +![](/images/function.png){width=75%} + +For example, the function `sum()` expects numbers: + +```{r} +sum(3, 5, 9, 18) +``` + +If you instead pass text as arguments to `sum()` you will receive an error: + +```{r error = TRUE} +sum("Sum", "does", "not", "accept", "text!") +``` + + +## R packages + +The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to "open" the package by loading it. + +### Installing Packages + +In this tutorial, we will be using the "tidyverse" package. This package contains a versatile set of functions designed for easy manipulation of data. + +You should have already installed the "tidyverse" package using RStudio's graphical interface. Packages can also be installed by entering the function `install.packages()` in the console (to install a different package just replace "tidyverse" with the name of the desired package): + +**For R v3.4 or newer** +```{r eval = FALSE} +install.packages("tidyverse") +``` + +**For R v3.3 or older** +Unfortunately, tidyverse does not work on older versions of R. Instead, you will need to individually install each package within the tidyverse. +```{r eval = FALSE} +install.packages("tibble") +install.packages("readr") +install.packages("dplyr") +install.packages("tidyr") +install.packages("ggplot2") +install.packages("stringr") +install.packages("purrr") +install.packages("forcats") +``` + +### Loading packages + +After installing a package, and *everytime* you open a new RStudio session, you need to first load (open) the packages you want to use with the `library()` function. This tells R to access the package's functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it. + +Packages can be loaded like this: + +```{r eval = FALSE} +library(tidyverse) +``` + + + +## Working with data + +### Data description + +The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia. + +The data that you will use in R are 16S amplicon profiles of microbial communities at several depths in Saanich Inlet from one time-point in this series (August 2012). These ~300 bp sequences were processed using [mothur](https://www.mothur.org/wiki/Main_Page) to yield 97% (approximately species-level) operational taxonomic units (OTUs). + +`Saanich_OTU_metadata.csv` is a comma-delimited table of counts of four OTUs in each sample, normalized to 100,000 sequences per sample and the corresponding conditions of each sample (Depth, NO2, NO3 etc.). + +For a brief introduction to these data, see Hallam SJ et al. 2017. Monitoring microbial responses to ocean deoxygenation in a model oxygen minimum zone. Sci Data 4: 170158 [doi:10.1038/sdata.2017.158](https://www.nature.com/articles/sdata2017158). + +### Loading tabular data + +Data tables can be loaded into R using the tidyverse `read_*` function. + +For example, we can load our Saanich data into R with `read_csv` for a comma-separated file and specify the arguments that describe our data as follows: + +- `file`: the name of the file you want to load +- `col_names`: can take either the value `TRUE` or `FALSE` and tells R if the first row contains column names + +```{r, eval = FALSE} +read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE) +``` + +```{r, echo = FALSE} +OTU_metadata_table <- combined +``` + +### Save data in the environment + +Since we want to do more with our data after reading it in, we need to save it as a variable in R as we did previously with the `<-` operator. You can choose to name the object whatever you like, though this module assumes the names used below. + +```{r eval = FALSE} +OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE) +``` + +### Data exploration + +Let's explore the data that we've imported into R. + +Using different functions, we can look at the dimensions of our data, number of rows, and number of columns: +```{r} +#number of rows followed by number of columns +dim(OTU_metadata_table) + +#number of rows +nrow(OTU_metadata_table) + +#number of columns +ncol(OTU_metadata_table) +``` + +We can list the column names using `colnames()`: +```{r} +colnames(OTU_metadata_table) +``` + +We can select to work with only specific columns/variables from our table using the `select()` function: +```{r} +restricted_columns <- select(OTU_metadata_table, Depth, OTU0001, OTU0002, + OTU0004) +``` + +We can filter for specific rows based on a column value using the `filter()` function. Here we restrict for rows where the value for `Depth` is < 135. + +```{r} +above_135_depth <- filter(OTU_metadata_table, Depth < 135) +``` + +We can also only choose to work with specific rows based on their position in our data table using the `slice()` function. + +```{r} +first_five_rows <- slice(OTU_metadata_table, 1:5) +``` + + + +## Getting Help +You can get help with any function in R by inputting `?function_name` into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code. + +```{r eval = FALSE} +?read_delim +``` + +The **Description** section tells us that `read_delim()` is a general case of the function we used, `read_csv()`, and `read_tsv()`. + +The **Usage** section tells us the inputs that need to be specified and default inputs of read_delim: + +- `file` and `delim` need to be specified as they are not followed by `=` +- all other parameters have a default value e.g. `quote = "\""` and do not have to be specified to run the function. + +The **Arguments** Section describes the requirements of each input argument in detail. + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. + + + +## R Scripts + +R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R's primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results. + +Generally, if you are testing an operation (*e.g.* what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (*e.g.* I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use. + +Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the `#` symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does. + +Let's create an R script (File > New File > R Script) and save it as `tidyverse.R` in your main project directory. If you again look to the project directory on your computer, you will see `tidyverse.R` is now saved there. + +We can copy and paste the previous commands in this tutorial and aggregate it in our R script. From 3100f3ba730935cbd738fe659a4e2df48167ba6a Mon Sep 17 00:00:00 2001 From: Stephan Koenig Date: Fri, 25 Sep 2020 08:58:12 -0700 Subject: [PATCH 02/20] Fix text formatting and add donwload link for data --- .../r_and_rstudio_basic.Rmd | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 8e5fb6c..8fcb071 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -56,22 +56,22 @@ To change the look of RStudio, you can go to Tools → Global Options → ## RStudio Projects -Projects are a great feature of RStudio. When you create a project, RStudio creates an ".Rproj" file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer like "/Users/username/Desktop/". R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in ".RData" so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. +Projects are a great feature of RStudio. When you create a project, RStudio creates an `.Rproj` file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like `/Users//Desktop/`). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in `.RData` so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. -RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labelled "Project: (None)", initially.) +RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labeled "Project: (None)", initially.) Let's create a project to work in for this tutorial. Start by clicking the "Project" button in the upper right or going to the "File" menu. Select "New Project", and the following will appear: ![](/images/create_project.png){width=75%} -Choose "New Directory" followed by "New Project" and click on "Browse...". Navigate to your Desktop, and name the directory "\ R"(replace \ with the name of your class, e.g. "MICB301") for this project. +Choose "New Directory" followed by "New Project" and click on "Browse...". Navigate to your Desktop, and name the directory ` R`(replace `` with the name of your class, e.g. `MICB301`) for this project. After your project is created, navigate to its directory using your Finder/File explorer or the integrated Terminal in RStudio. You will see the ".RProj" file has been created. You can open this project in the future in one of three ways: -- In your Finder/file browser, simply double-click on the ".RProj" file +- In your file browser (e.g. Finder or Explorer), simply double-click on the `.RProj` file - In an open RStudio window, choose "File" → "Open Project" - Switch among projects by clicking on the R project symbol in the upper left corner of RStudio @@ -153,23 +153,11 @@ In this tutorial, we will be using the "tidyverse" package. This package contain You should have already installed the "tidyverse" package using RStudio's graphical interface. Packages can also be installed by entering the function `install.packages()` in the console (to install a different package just replace "tidyverse" with the name of the desired package): -**For R v3.4 or newer** ```{r eval = FALSE} install.packages("tidyverse") ``` -**For R v3.3 or older** -Unfortunately, tidyverse does not work on older versions of R. Instead, you will need to individually install each package within the tidyverse. -```{r eval = FALSE} -install.packages("tibble") -install.packages("readr") -install.packages("dplyr") -install.packages("tidyr") -install.packages("ggplot2") -install.packages("stringr") -install.packages("purrr") -install.packages("forcats") -``` + ### Loading packages @@ -189,7 +177,7 @@ library(tidyverse) The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia. -The data that you will use in R are 16S amplicon profiles of microbial communities at several depths in Saanich Inlet from one time-point in this series (August 2012). These ~300 bp sequences were processed using [mothur](https://www.mothur.org/wiki/Main_Page) to yield 97% (approximately species-level) operational taxonomic units (OTUs). +The data that you will use in R are 16S rRNA amplicon profiles of microbial communities at several depths in Saanich Inlet from one time-point in this series (August 2012). These ~300 bp sequences were processed using [mothur](https://www.mothur.org/wiki/Main_Page) to yield 97% (approximately species-level) operational taxonomic units (OTUs). `Saanich_OTU_metadata.csv` is a comma-delimited table of counts of four OTUs in each sample, normalized to 100,000 sequences per sample and the corresponding conditions of each sample (Depth, NO2, NO3 etc.). @@ -197,7 +185,9 @@ For a brief introduction to these data, see Hallam SJ et al. 2017. Monitoring mi ### Loading tabular data -Data tables can be loaded into R using the tidyverse `read_*` function. +Data tables can be loaded into R using the tidyverse `read_*` function. + +in your file browser, create a `data` directory in your project directory. Download the [`Saanich_OTU_metadata.csv`](https://github.com/EDUCE-UBC/educer/blob/master/data-raw/Saanich_OTU_metadata.csv) file and save it in your `data` directory. For example, we can load our Saanich data into R with `read_csv` for a comma-separated file and specify the arguments that describe our data as follows: @@ -247,7 +237,7 @@ restricted_columns <- select(OTU_metadata_table, Depth, OTU0001, OTU0002, OTU0004) ``` -We can filter for specific rows based on a column value using the `filter()` function. Here we restrict for rows where the value for `Depth` is < 135. +We can filter for specific rows based on a column value using the `filter()` function. Here we restrict for rows where the value for `Depth` is smaller than 135. ```{r} above_135_depth <- filter(OTU_metadata_table, Depth < 135) @@ -273,7 +263,7 @@ The **Description** section tells us that `read_delim()` is a general case of th The **Usage** section tells us the inputs that need to be specified and default inputs of read_delim: - `file` and `delim` need to be specified as they are not followed by `=` -- all other parameters have a default value e.g. `quote = "\""` and do not have to be specified to run the function. +- all other parameters have a default value e.g. `quote = "\"` and do not have to be specified to run the function. The **Arguments** Section describes the requirements of each input argument in detail. From 09c6fca883802e5fa36861dbcb5e16e376281a19 Mon Sep 17 00:00:00 2001 From: Stephan Koenig Date: Tue, 6 Oct 2020 15:27:28 -0700 Subject: [PATCH 03/20] Apply suggestions from TA code review Co-authored-by: Ryan Karimi <66281159+r-karimi@users.noreply.github.com> Co-authored-by: ymkng <37229946+ymkng@users.noreply.github.com> Co-authored-by: Pranav Sampara <56938339+psampara@users.noreply.github.com> Co-authored-by: Cathy <59323254+cathy-y@users.noreply.github.com> Co-authored-by: Avery Noonan --- .../r_and_rstudio_basic.Rmd | 126 +++++++++++++++--- 1 file changed, 110 insertions(+), 16 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 8fcb071..34cf637 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -7,7 +7,7 @@ output: progressive: true allow_skip: true runtime: shiny_prerendered -description: In-depth description will follow. +description: This tutorial covers the basics of R and RStudio. You will learn about the different panes and features of RStudio that make coding in R easier, as well as basic skills of the R language itself, such as creating functions and loading packages. --- ```{r setup, include = FALSE} @@ -21,6 +21,7 @@ setup_resources() # Tutorial specific setup library(dplyr) library(readr) +total <- 4 ``` ## Learning objectives @@ -33,7 +34,7 @@ By the end of this tutorial you should be able to: - Install and load R packages. - Load and subset tabular data using tidyverse. - Use the `help` function in R console to troubleshoot given a new function. - +The last bullet point can be more descriptive saying, "Use the `help` function in R console to troubleshoot and *identify mandatory parameters* given a new function." ## A Tour of RStudio @@ -51,7 +52,7 @@ Notice that the window has three "panes": - Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages. To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan to be working for longer periods, we suggest choosing a dark background colour scheme to save your computer battery and your eyes. - +You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. ## RStudio Projects @@ -84,37 +85,34 @@ We use variables to store data that we want to access or manipulate later. Varia Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use: -```{r} +```{r novar, exercise=TRUE} 2 + 2 ``` To declare a variable, follow the pattern of: `variable <- value`. Let's declare a variable `total` as the sum of two numbers. -```{r} +```{r d_var, exercise=TRUE} total <- 2 + 2 ``` We access the value of `total`: -```{r} +```{r var, exercise=TRUE} total ``` We can use the value stored in `total`: -```{r} +```{r sub_var, exercise=TRUE} total - 1 ``` After declaring a variable, we can perform operations to change the value stored in the variable: -```{r} +```{r sub_var2, exercise=TRUE} total <- total - 1 -``` -Now `total` stores a new value: -```{r} total ``` @@ -122,26 +120,49 @@ total ## Functions -Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): +Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): `function(argument1 = ..., argument2 = ..., ...)` -You can treat functions as a black box and do not necessarily need to know how it works under the hood as long as your provided input conforms to a specific shape. +You can treat functions as a black box and do not necessarily need to know how it works under the hood as long as your provided input conforms to a specific format. ![](/images/function.png){width=75%} -For example, the function `sum()` expects numbers: +For example, the function `sum()` (which outputs the sum of the arguments) expects numbers: -```{r} +```{r sum_function, exercise=TRUE} sum(3, 5, 9, 18) ``` If you instead pass text as arguments to `sum()` you will receive an error: -```{r error = TRUE} +```{r sum_text, exercise=TRUE, error = TRUE} sum("Sum", "does", "not", "accept", "text!") ``` +The use of functions isn't limited to mathematical calculations. Function can also be used to transform data. + +For example, the function `t()` can be used to transpose a matrix. In the example below, we generate a matrix (`example_matrix`) using the functions `c()` and `as.matrix()`, which were used to combine values into a vector and transform the vector into a matrix. We then use the `t()` function to transpose `example_matrix` into the matrix `example_transposed`. + +```{r t_function, exercise=TRUE} +# Generate Matrix +example_list <- c("T", "does", "accept", "text!") +example_matrix <- as.matrix(example_list) + +#Transpose Matrix +example_transposed <- t(example_matrix) + +#Display Original and Transposed Matrices +example_matrix +example_transposed +``` +### The most helpful function of all: the 'help' function +You can get information about a specific function by running the command `?` or `help()` (replace `` by the name of the function you are interested in). This command opens the help page, where you can find all information about a function's purpose and its arguments. For beginners, it is useful to concentrate on the "Examples" and "Arguments" section to understand the typical usage of the function better. + +Run the code below to read the documentation for the `t()` function. +```{r transpose_help, exercise=TRUE} +?t +``` ## R packages @@ -168,7 +189,16 @@ Packages can be loaded like this: ```{r eval = FALSE} library(tidyverse) ``` +It is a little tricker to load Bioconductor packages, as they are often not stored on the Comprehensive R Archive Network (CRAN) where most packages live. There is a package, however, that lives on CRAN and serves as an interface between CRAN and the Bioconductor packages. +To load a Bioconductor package, you must first install and load the BiocManager package, like so. + +`install.packages("BiocManager")` +`library("BiocManager)` + +You can then use the function `BiocManager::install()` to install a Bioconductor package. To install the Annotate package, we would execute the following code. + +`BiocManager::install("annotate")` ## Working with data @@ -269,8 +299,59 @@ The **Arguments** Section describes the requirements of each input argument in d The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. +Another example from base R that may be widely used is the function `nrow()` +```{r eval = FALSE} +?nrow +``` +The **Description** section tells us that `nrow()` from a matrix or an array. + +The **Usage** section tells us the inputs that need to be specified and default inputs of `nrow()`: + +- `x` is the data matrix or array for which the user is interested in identifying the number of rows + +The **Arguments** Section describes the requirements of each input argument in detail. + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. + + + +Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be `select()` + +```{r eval = FALSE} +if (!require("tidyverse")) install.packages("tidyverse") +library(tidyverse) +?select +``` + +The **Description** section tells us that `select()` can be used to select certain columns from a parent dataset, or optionally rename the columns + +The **Overview of selection features** section provides the user a list of operators and selection helpers to fully realize the power of `select()` + +The **Usage** section tells us the inputs that need to be specified and default inputs of `select()` + +- `.data` is a mandatory input which refers to the parent dataset or tibble to subset from +- the helper functions and list of operators could be used to specify the columns to subset + +The **Value** section describes an object integral to `select()`. A more descriptive account can be read in the help section + +The **Method** section describes the implementation method of the function `select()` + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. +```{r quiz: navigating help, echo=FALSE} +question("How would you launch a help section for a given function", + answer("Place an exclamation mark in front of the function"), + answer("Place an question mark in front of the function", correct = TRUE), + answer("Place an question mark after of the function"), + answer("Type out help and function name in the console") +) + +question("What does an = sign indicate in the help section", + answer("There exists a default and is not mandatory", correct = TRUE), + answer("Is a mandatory input in the function") +) +``` ## R Scripts R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R's primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results. @@ -282,3 +363,16 @@ Additionally, you should annotate your R scripts with comments. In each line of Let's create an R script (File > New File > R Script) and save it as `tidyverse.R` in your main project directory. If you again look to the project directory on your computer, you will see `tidyverse.R` is now saved there. We can copy and paste the previous commands in this tutorial and aggregate it in our R script. + +```{r quiz: R Scripts, echo=FALSE} +question("How do R scripts make your work reproducible?", + answer("Trick question: they work just like Excel and don't make work reproducible"), + answer("They keep a record of all actions done to get from raw data to final results", correct=TRUE), + answer("You can use them to test different operations on your data") +) + +question("How do you annotate R scripts with comments?", + answer("You start the line with 'comment:'), + answer("You start the line with the # symbol", correct=TRUE), + answer("You can just start typing and R will know it's a comment automatically") +) From 5d9bcbbd7b4e723afe0eecb711a017610c63ab27 Mon Sep 17 00:00:00 2001 From: Cathy <59323254+cathy-y@users.noreply.github.com> Date: Sat, 17 Oct 2020 16:03:16 -0700 Subject: [PATCH 04/20] Apply suggestions from code review Co-authored-by: Ryan Karimi <66281159+r-karimi@users.noreply.github.com> --- .../r_and_rstudio_basic.Rmd | 143 ++++++++++-------- 1 file changed, 77 insertions(+), 66 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 34cf637..cea0891 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -7,7 +7,7 @@ output: progressive: true allow_skip: true runtime: shiny_prerendered -description: This tutorial covers the basics of R and RStudio. You will learn about the different panes and features of RStudio that make coding in R easier, as well as basic skills of the R language itself, such as creating functions and loading packages. +description: Welcome to R! If you want to analyze and visualize data reproducibly, you've come to the right place. This tutorial covers the basics of R and RStudio. RStudio is a free program used for coding in R. After learning about its features and functionality, we will dive into R language basics, where you will create functions and load packages. --- ```{r setup, include = FALSE} @@ -33,31 +33,42 @@ By the end of this tutorial you should be able to: - Recognize and use functions. - Install and load R packages. - Load and subset tabular data using tidyverse. -- Use the `help` function in R console to troubleshoot given a new function. -The last bullet point can be more descriptive saying, "Use the `help` function in R console to troubleshoot and *identify mandatory parameters* given a new function." +- Use the `help` function in R console to troubleshoot and identify required arguments for a given function ## A Tour of RStudio - +By the end of this section, you will be able to: +- Name the three panes in RStudio and what they do +- Change the sizes of the panes +- Navigate through the console using common keyboard shortcuts +- Change the appearance of RStudio When you start RStudio, you will see something like the following window appear: ![](/images/rstudio.png){width=100%} Notice that the window has three "panes": -- Console (lower left side): this is your view of the R engine. You can type in R commands here and see the output printed by R. (To tell them apart, your input is in blue, and the output is black.) There are several editing conveniences available: use up and down arrow keys to go back to previously entered commands, which you then can edit and re-run; TAB for completing the name before the cursor; see more in [online docs](http://www.rstudio.com/ide/docs/using/keyboard_shortcuts). +- Console (lower left side): this is your view of the R engine. You can type in R commands here and see the output printed by R. (To tell them apart, your input is in blue, and the output is black.) There are several editing conveniences available: up and down arrow keys to go back to previously entered commands which you then can edit and re-run, TAB for completing the name before the cursor, and so on. See more in [online docs](http://www.rstudio.com/ide/docs/using/keyboard_shortcuts). - Environment/History (tabbed in the upper right): view current user-defined objects and previously-entered commands, respectively. - Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages. -To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan to be working for longer periods, we suggest choosing a dark background colour scheme to save your computer battery and your eyes. +To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. - +```{r quiz: R Tour, echo=FALSE} +question("Which pane enables you to manage R packages?", + answer("The console"), + answer("Lower right pane", correct=TRUE), + answer("Upper right pane") +) ## RStudio Projects - -Projects are a great feature of RStudio. When you create a project, RStudio creates an `.Rproj` file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like `/Users//Desktop/`). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in `.RData` so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. +By the end of this section, you will be able to: +- List the benefits of using RStudio Projects +- Create a new RStudio Project +- Open or switch to an existing RStudio Project +When you create a project, RStudio creates an `.Rproj` file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like `/Users//Desktop/`). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in `.RData` so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labeled "Project: (None)", initially.) @@ -77,10 +88,17 @@ You can open this project in the future in one of three ways: - Switch among projects by clicking on the R project symbol in the upper left corner of RStudio - +```{r quiz: R Projects, echo=FALSE} +question("What is not a benefit of using RStudio projects?", + answer("All of your files and outputs are linked to the project directory"), + answer("R automatically looks for files in the project directory so you don't have to specify a full file path"), + answer("When you reopen a project, your code is saved so all you need to do is rerun it", correct=TRUE) +) ## Variables in R - +By the end of this section, you will be able to: +- Declare variables +- Perform operations to change the value of variables We use variables to store data that we want to access or manipulate later. Variables must have unique names. Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use: @@ -115,11 +133,33 @@ total <- total - 1 total ``` +Now it's your turn! Declare a variable "product" and set its value to 3 * 5. Next, operating on "product", declare a variable called "difference", whose final value is 8. +```{r product, exercise=TRUE} +# First declare "product" +product +# Operate on "product" to get 8 as the value for "difference" +difference -## Functions +```{r product-hint-1} +# First declare "product" +product <- #your code here + +# Operate on "product" to get 8 as the value for "difference" +difference <- product #your code here + +```{r product-solution} +# First declare "product" +product <- 3 * 5 + +# Operate on "product" to get 8 as the value for "difference" +difference <- product - 7 + +## Functions +By the end of this section, you will be able to: +- Explain what functions and arguments are Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): `function(argument1 = ..., argument2 = ..., ...)` @@ -154,18 +194,15 @@ example_transposed <- t(example_matrix) #Display Original and Transposed Matrices example_matrix example_transposed -``` -### The most helpful function of all: the 'help' function -You can get information about a specific function by running the command `?` or `help()` (replace `` by the name of the function you are interested in). This command opens the help page, where you can find all information about a function's purpose and its arguments. For beginners, it is useful to concentrate on the "Examples" and "Arguments" section to understand the typical usage of the function better. - -Run the code below to read the documentation for the `t()` function. - -```{r transpose_help, exercise=TRUE} -?t -``` - +```{r quiz: R Functions, echo=FALSE} +question("True or False: Functions accept inputs of all types", + answer("True"), + answer("False", correct=TRUE) +) ## R packages - +By the end of this section, you will be able to: +- Understand what R packages are and how they are used +- Install and load packages The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to "open" the package by loading it. ### Installing Packages @@ -200,9 +237,15 @@ You can then use the function `BiocManager::install()` to install a Bioconductor `BiocManager::install("annotate")` - +```{r quiz: R Packages, echo=FALSE} +question("True or False: Packages are installed once, but loaded every time", + answer("True", correct=TRUE), + answer("False") +) ## Working with data - +By the end of this section, you will be able to: +- Load data into R +- Save loaded data in the environment ### Data description The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia. @@ -215,7 +258,7 @@ For a brief introduction to these data, see Hallam SJ et al. 2017. Monitoring mi ### Loading tabular data -Data tables can be loaded into R using the tidyverse `read_*` function. +Tabular data can be loaded into R using the tidyverse `read_*` functions, which generate data frames. Each row in a data frame represents one observation, and each column represents one variable. in your file browser, create a `data` directory in your project directory. Download the [`Saanich_OTU_metadata.csv`](https://github.com/EDUCE-UBC/educer/blob/master/data-raw/Saanich_OTU_metadata.csv) file and save it in your `data` directory. @@ -240,48 +283,13 @@ Since we want to do more with our data after reading it in, we need to save it a OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE) ``` -### Data exploration - -Let's explore the data that we've imported into R. - -Using different functions, we can look at the dimensions of our data, number of rows, and number of columns: -```{r} -#number of rows followed by number of columns -dim(OTU_metadata_table) - -#number of rows -nrow(OTU_metadata_table) - -#number of columns -ncol(OTU_metadata_table) -``` - -We can list the column names using `colnames()`: -```{r} -colnames(OTU_metadata_table) -``` - -We can select to work with only specific columns/variables from our table using the `select()` function: -```{r} -restricted_columns <- select(OTU_metadata_table, Depth, OTU0001, OTU0002, - OTU0004) -``` - -We can filter for specific rows based on a column value using the `filter()` function. Here we restrict for rows where the value for `Depth` is smaller than 135. - -```{r} -above_135_depth <- filter(OTU_metadata_table, Depth < 135) -``` - -We can also only choose to work with specific rows based on their position in our data table using the `slice()` function. - -```{r} -first_five_rows <- slice(OTU_metadata_table, 1:5) -``` - ## Getting Help +By the end of this section, you will be able to: +- Use R to understand how any given function works +- Identify required and optional arguments for functions + You can get help with any function in R by inputting `?function_name` into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code. ```{r eval = FALSE} @@ -353,7 +361,10 @@ question("What does an = sign indicate in the help section", ) ``` ## R Scripts - +By the end of this section, you will be able to: +- Create an R script file +- List the benefits of using R scripts +- Annotate R scripts with comments R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R's primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results. Generally, if you are testing an operation (*e.g.* what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (*e.g.* I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use. From a6ab1b7cff482a70bee292dc22017fc3e4c4e461 Mon Sep 17 00:00:00 2001 From: Cathy <59323254+cathy-y@users.noreply.github.com> Date: Sat, 17 Oct 2020 16:03:46 -0700 Subject: [PATCH 05/20] Apply suggestions from code review Co-authored-by: Ryan Karimi <66281159+r-karimi@users.noreply.github.com> --- inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index cea0891..6fef24a 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -236,7 +236,7 @@ To load a Bioconductor package, you must first install and load the BiocManager You can then use the function `BiocManager::install()` to install a Bioconductor package. To install the Annotate package, we would execute the following code. `BiocManager::install("annotate")` - +Sometimes two packages include functions with the same name. A common example is that a `select()` function is included both in the `dplyr` and `MASS` packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: `package::function()`. ```{r quiz: R Packages, echo=FALSE} question("True or False: Packages are installed once, but loaded every time", answer("True", correct=TRUE), From 53f8905793977598dac7877357886e1e96628ee9 Mon Sep 17 00:00:00 2001 From: cathyy37 <59323254+cathyy37@users.noreply.github.com> Date: Fri, 23 Oct 2020 15:05:14 -0700 Subject: [PATCH 06/20] Fixed markups for code chunks --- .../r_and_rstudio_basic.Rmd | 43 +- .../r_and_rstudio_basic.html | 593 ++++++++++++++++++ 2 files changed, 622 insertions(+), 14 deletions(-) create mode 100644 inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 6fef24a..fe8f0cd 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -7,7 +7,7 @@ output: progressive: true allow_skip: true runtime: shiny_prerendered -description: Welcome to R! If you want to analyze and visualize data reproducibly, you've come to the right place. This tutorial covers the basics of R and RStudio. RStudio is a free program used for coding in R. After learning about its features and functionality, we will dive into R language basics, where you will create functions and load packages. +description: Welcome to R! If you want to analyze and visualize data reproducibly, you've come to the right place. This tutorial covers the basics of R and RStudio. RStudio is a free program used for coding in R. After learning about its features and functionality, we will dive into R language basics. --- ```{r setup, include = FALSE} @@ -55,13 +55,15 @@ Notice that the window has three "panes": - Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages. To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. -You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. -```{r quiz: R Tour, echo=FALSE} +You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. + +```{r Tour, echo=FALSE} question("Which pane enables you to manage R packages?", answer("The console"), answer("Lower right pane", correct=TRUE), answer("Upper right pane") ) +``` ## RStudio Projects By the end of this section, you will be able to: @@ -88,12 +90,13 @@ You can open this project in the future in one of three ways: - Switch among projects by clicking on the R project symbol in the upper left corner of RStudio -```{r quiz: R Projects, echo=FALSE} +```{r Projects, echo=FALSE} question("What is not a benefit of using RStudio projects?", answer("All of your files and outputs are linked to the project directory"), answer("R automatically looks for files in the project directory so you don't have to specify a full file path"), answer("When you reopen a project, your code is saved so all you need to do is rerun it", correct=TRUE) ) +``` ## Variables in R By the end of this section, you will be able to: @@ -133,6 +136,7 @@ total <- total - 1 total ``` + Now it's your turn! Declare a variable "product" and set its value to 3 * 5. Next, operating on "product", declare a variable called "difference", whose final value is 8. ```{r product, exercise=TRUE} @@ -141,6 +145,7 @@ product # Operate on "product" to get 8 as the value for "difference" difference +``` ```{r product-hint-1} # First declare "product" @@ -148,6 +153,7 @@ product <- #your code here # Operate on "product" to get 8 as the value for "difference" difference <- product #your code here +``` ```{r product-solution} # First declare "product" @@ -155,7 +161,7 @@ product <- 3 * 5 # Operate on "product" to get 8 as the value for "difference" difference <- product - 7 - +``` ## Functions By the end of this section, you will be able to: @@ -179,6 +185,7 @@ If you instead pass text as arguments to `sum()` you will receive an error: ```{r sum_text, exercise=TRUE, error = TRUE} sum("Sum", "does", "not", "accept", "text!") ``` + The use of functions isn't limited to mathematical calculations. Function can also be used to transform data. For example, the function `t()` can be used to transpose a matrix. In the example below, we generate a matrix (`example_matrix`) using the functions `c()` and `as.matrix()`, which were used to combine values into a vector and transform the vector into a matrix. We then use the `t()` function to transpose `example_matrix` into the matrix `example_transposed`. @@ -194,11 +201,15 @@ example_transposed <- t(example_matrix) #Display Original and Transposed Matrices example_matrix example_transposed -```{r quiz: R Functions, echo=FALSE} +``` + +```{r Functions, echo=FALSE} question("True or False: Functions accept inputs of all types", answer("True"), answer("False", correct=TRUE) ) +``` + ## R packages By the end of this section, you will be able to: - Understand what R packages are and how they are used @@ -215,8 +226,6 @@ You should have already installed the "tidyverse" package using RStudio's graphi install.packages("tidyverse") ``` - - ### Loading packages After installing a package, and *everytime* you open a new RStudio session, you need to first load (open) the packages you want to use with the `library()` function. This tells R to access the package's functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it. @@ -226,6 +235,7 @@ Packages can be loaded like this: ```{r eval = FALSE} library(tidyverse) ``` + It is a little tricker to load Bioconductor packages, as they are often not stored on the Comprehensive R Archive Network (CRAN) where most packages live. There is a package, however, that lives on CRAN and serves as an interface between CRAN and the Bioconductor packages. To load a Bioconductor package, you must first install and load the BiocManager package, like so. @@ -237,15 +247,19 @@ You can then use the function `BiocManager::install()` to install a Bioconductor `BiocManager::install("annotate")` Sometimes two packages include functions with the same name. A common example is that a `select()` function is included both in the `dplyr` and `MASS` packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: `package::function()`. -```{r quiz: R Packages, echo=FALSE} + +```{r Packages, echo=FALSE} question("True or False: Packages are installed once, but loaded every time", answer("True", correct=TRUE), answer("False") ) +``` + ## Working with data By the end of this section, you will be able to: - Load data into R - Save loaded data in the environment + ### Data description The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia. @@ -283,8 +297,6 @@ Since we want to do more with our data after reading it in, we need to save it a OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE) ``` - - ## Getting Help By the end of this section, you will be able to: - Use R to understand how any given function works @@ -347,7 +359,8 @@ The **Value** section describes an object integral to `select()`. A more descrip The **Method** section describes the implementation method of the function `select()` The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. -```{r quiz: navigating help, echo=FALSE} + +```{r Help, echo=FALSE} question("How would you launch a help section for a given function", answer("Place an exclamation mark in front of the function"), answer("Place an question mark in front of the function", correct = TRUE), @@ -360,6 +373,7 @@ question("What does an = sign indicate in the help section", answer("Is a mandatory input in the function") ) ``` + ## R Scripts By the end of this section, you will be able to: - Create an R script file @@ -375,7 +389,7 @@ Let's create an R script (File > New File > R Script) and save it as `tidyverse. We can copy and paste the previous commands in this tutorial and aggregate it in our R script. -```{r quiz: R Scripts, echo=FALSE} +```{r Scripts, echo=FALSE} question("How do R scripts make your work reproducible?", answer("Trick question: they work just like Excel and don't make work reproducible"), answer("They keep a record of all actions done to get from raw data to final results", correct=TRUE), @@ -383,7 +397,8 @@ question("How do R scripts make your work reproducible?", ) question("How do you annotate R scripts with comments?", - answer("You start the line with 'comment:'), + answer("You start the line with 'comment:'"), answer("You start the line with the # symbol", correct=TRUE), answer("You can just start typing and R will know it's a comment automatically") ) +``` diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html new file mode 100644 index 0000000..84ec6a3 --- /dev/null +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -0,0 +1,593 @@ + + + + + + + + + + + + + + + + +Introduction to R and RStudio fundamentals + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+

Learning objectives

+

By the end of this tutorial you should be able to:

+
    +
  • Identify the different components of RStudio.
  • +
  • Declare variables in R.
  • +
  • Recognize and use functions.
  • +
  • Install and load R packages.
  • +
  • Load and subset tabular data using tidyverse.
  • +
  • Use the help function in R console to troubleshoot and identify required arguments for a given function
  • +
+
+
+

A Tour of RStudio

+

By the end of this section, you will be able to: - Name the three panes in RStudio and what they do - Change the sizes of the panes - Navigate through the console using common keyboard shortcuts - Change the appearance of RStudio When you start RStudio, you will see something like the following window appear:

+

+

Notice that the window has three “panes”:

+
    +
  • Console (lower left side): this is your view of the R engine. You can type in R commands here and see the output printed by R. (To tell them apart, your input is in blue, and the output is black.) There are several editing conveniences available: up and down arrow keys to go back to previously entered commands which you then can edit and re-run, TAB for completing the name before the cursor, and so on. See more in online docs.

  • +
  • Environment/History (tabbed in the upper right): view current user-defined objects and previously-entered commands, respectively.

  • +
  • Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages.

  • +
+

To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane.

+
+
+
+
+
+ +
+
+
+
+

RStudio Projects

+

By the end of this section, you will be able to: - List the benefits of using RStudio Projects - Create a new RStudio Project - Open or switch to an existing RStudio Project When you create a project, RStudio creates an .Rproj file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like /Users/<username>/Desktop/). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in .RData so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps.

+

RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labeled “Project: (None)”, initially.)

+

Let’s create a project to work in for this tutorial. Start by clicking the “Project” button in the upper right or going to the “File” menu. Select “New Project”, and the following will appear:

+

+

Choose “New Directory” followed by “New Project” and click on “Browse…”. Navigate to your Desktop, and name the directory <course_name> R(replace <course_name> with the name of your class, e.g. MICB301) for this project.

+

After your project is created, navigate to its directory using your Finder/File explorer or the integrated Terminal in RStudio. You will see the “.RProj” file has been created.

+

You can open this project in the future in one of three ways:

+
    +
  • In your file browser (e.g. Finder or Explorer), simply double-click on the .RProj file
  • +
  • In an open RStudio window, choose “File” → “Open Project”
  • +
  • Switch among projects by clicking on the R project symbol in the upper left corner of RStudio
  • +
+
+
+
+
+
+ +
+
+
+
+

Variables in R

+

By the end of this section, you will be able to: - Declare variables - Perform operations to change the value of variables We use variables to store data that we want to access or manipulate later. Variables must have unique names.

+

Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use:

+
+
2 + 2 
+ +
+

To declare a variable, follow the pattern of: variable <- value. Let’s declare a variable total as the sum of two numbers.

+
+
total <- 2 + 2
+ +
+

We access the value of total:

+
+
total
+ +
+

We can use the value stored in total:

+
+
total - 1
+ +
+

After declaring a variable, we can perform operations to change the value stored in the variable:

+
+
total <- total - 1
+
+
+total
+ +
+

Now it’s your turn! Declare a variable “product” and set its value to 3 * 5. Next, operating on “product”, declare a variable called “difference”, whose final value is 8.

+
+
# First declare "product"
+product
+
+# Operate on "product" to get 8 as the value for "difference"
+difference
+ +
+
+
# First declare "product"
+product <- #your code here
+
+# Operate on "product" to get 8 as the value for "difference"
+difference <- product #your code here
+
+
+
# First declare "product"
+product <- 3 * 5
+
+# Operate on "product" to get 8 as the value for "difference"
+difference <- product - 7
+
+
+
+

Functions

+

By the end of this section, you will be able to: - Explain what functions and arguments are Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where function() is the name of the function and arguments are the different parameters you can specify (i.e. your input):

+

function(argument1 = ..., argument2 = ..., ...)

+

You can treat functions as a black box and do not necessarily need to know how it works under the hood as long as your provided input conforms to a specific format.

+

+

For example, the function sum() (which outputs the sum of the arguments) expects numbers:

+
+
sum(3, 5, 9, 18)
+ +
+

If you instead pass text as arguments to sum() you will receive an error:

+
+
sum("Sum", "does", "not", "accept", "text!")
+ +
+

The use of functions isn’t limited to mathematical calculations. Function can also be used to transform data.

+

For example, the function t() can be used to transpose a matrix. In the example below, we generate a matrix (example_matrix) using the functions c() and as.matrix(), which were used to combine values into a vector and transform the vector into a matrix. We then use the t() function to transpose example_matrix into the matrix example_transposed.

+
+
# Generate Matrix
+example_list <- c("T", "does", "accept", "text!")
+example_matrix <- as.matrix(example_list)
+
+#Transpose Matrix
+example_transposed <- t(example_matrix)
+
+#Display Original and Transposed Matrices
+example_matrix
+example_transposed
+ +
+
+
+
+
+
+ +
+
+
+
+

R packages

+

By the end of this section, you will be able to: - Understand what R packages are and how they are used - Install and load packages The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to “open” the package by loading it.

+
+

Installing Packages

+

In this tutorial, we will be using the “tidyverse” package. This package contains a versatile set of functions designed for easy manipulation of data.

+

You should have already installed the “tidyverse” package using RStudio’s graphical interface. Packages can also be installed by entering the function install.packages() in the console (to install a different package just replace “tidyverse” with the name of the desired package):

+
install.packages("tidyverse")
+
+
+

Loading packages

+

After installing a package, and everytime you open a new RStudio session, you need to first load (open) the packages you want to use with the library() function. This tells R to access the package’s functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it.

+

Packages can be loaded like this:

+
library(tidyverse)
+

It is a little tricker to load Bioconductor packages, as they are often not stored on the Comprehensive R Archive Network (CRAN) where most packages live. There is a package, however, that lives on CRAN and serves as an interface between CRAN and the Bioconductor packages.

+

To load a Bioconductor package, you must first install and load the BiocManager package, like so.

+

install.packages("BiocManager") library("BiocManager)

+

You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

+

BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

+
+
+
+
+
+ +
+
+
+
+
+

Working with data

+

By the end of this section, you will be able to: - Load data into R - Save loaded data in the environment

+
+

Data description

+

The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia.

+

The data that you will use in R are 16S rRNA amplicon profiles of microbial communities at several depths in Saanich Inlet from one time-point in this series (August 2012). These ~300 bp sequences were processed using mothur to yield 97% (approximately species-level) operational taxonomic units (OTUs).

+

Saanich_OTU_metadata.csv is a comma-delimited table of counts of four OTUs in each sample, normalized to 100,000 sequences per sample and the corresponding conditions of each sample (Depth, NO2, NO3 etc.).

+

For a brief introduction to these data, see Hallam SJ et al. 2017. Monitoring microbial responses to ocean deoxygenation in a model oxygen minimum zone. Sci Data 4: 170158 doi:10.1038/sdata.2017.158.

+
+
+

Loading tabular data

+

Tabular data can be loaded into R using the tidyverse read_* functions, which generate data frames. Each row in a data frame represents one observation, and each column represents one variable.

+

in your file browser, create a data directory in your project directory. Download the Saanich_OTU_metadata.csv file and save it in your data directory.

+

For example, we can load our Saanich data into R with read_csv for a comma-separated file and specify the arguments that describe our data as follows:

+
    +
  • file: the name of the file you want to load
  • +
  • col_names: can take either the value TRUE or FALSE and tells R if the first row contains column names
  • +
+
read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE)
+
+
+

Save data in the environment

+

Since we want to do more with our data after reading it in, we need to save it as a variable in R as we did previously with the <- operator. You can choose to name the object whatever you like, though this module assumes the names used below.

+
OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE)
+
+
+
+

Getting Help

+

By the end of this section, you will be able to: - Use R to understand how any given function works - Identify required and optional arguments for functions

+

You can get help with any function in R by inputting ?function_name into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code.

+
?read_delim
+

The Description section tells us that read_delim() is a general case of the function we used, read_csv(), and read_tsv().

+

The Usage section tells us the inputs that need to be specified and default inputs of read_delim:

+
    +
  • file and delim need to be specified as they are not followed by =
  • +
  • all other parameters have a default value e.g. quote = "\" and do not have to be specified to run the function.
  • +
+

The Arguments Section describes the requirements of each input argument in detail.

+

The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

+

Another example from base R that may be widely used is the function nrow()

+
?nrow
+

The Description section tells us that nrow() from a matrix or an array.

+

The Usage section tells us the inputs that need to be specified and default inputs of nrow():

+
    +
  • x is the data matrix or array for which the user is interested in identifying the number of rows
  • +
+

The Arguments Section describes the requirements of each input argument in detail.

+

The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

+

Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be select()

+
if (!require("tidyverse")) install.packages("tidyverse")
+library(tidyverse)
+?select
+

The Description section tells us that select() can be used to select certain columns from a parent dataset, or optionally rename the columns

+

The Overview of selection features section provides the user a list of operators and selection helpers to fully realize the power of select()

+

The Usage section tells us the inputs that need to be specified and default inputs of select()

+
    +
  • .data is a mandatory input which refers to the parent dataset or tibble to subset from
  • +
  • the helper functions and list of operators could be used to specify the columns to subset
  • +
+

The Value section describes an object integral to select(). A more descriptive account can be read in the help section

+

The Method section describes the implementation method of the function select()

+

The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

+

+
+
+
+
+ +
+
+
+
+
+
+ +
+

+
+
+

R Scripts

+

By the end of this section, you will be able to: - Create an R script file - List the benefits of using R scripts - Annotate R scripts with comments R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R’s primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results.

+

Generally, if you are testing an operation (e.g. what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (e.g. I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use.

+

Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the # symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does.

+

Let’s create an R script (File > New File > R Script) and save it as tidyverse.R in your main project directory. If you again look to the project directory on your computer, you will see tidyverse.R is now saved there.

+

We can copy and paste the previous commands in this tutorial and aggregate it in our R script.

+

+
+
+
+
+ +
+
+
+
+
+
+ +
+

+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+ + +
+ +

Michelle Kang (adapted from Dr. Kim Dill-McFarland)

+

version October 22, 2020

+
+ + +
+
+
+
+ + +
+
+ + + + + + + + + + + + + + From 4d92829880a7f20d3296d17296c4ccb14ba2b10d Mon Sep 17 00:00:00 2001 From: cathyy37 <59323254+cathyy37@users.noreply.github.com> Date: Sat, 24 Oct 2020 09:26:48 -0700 Subject: [PATCH 07/20] Restructured order of sections, moved learning objectives to the beginning of the tutorial, and changed t() function to paste() --- .../r_and_rstudio_basic.Rmd | 318 ++++++++--------- .../r_and_rstudio_basic.html | 324 +++++++++--------- 2 files changed, 331 insertions(+), 311 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index fe8f0cd..8ec3909 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -26,22 +26,50 @@ total <- 4 ## Learning objectives -By the end of this tutorial you should be able to: +Here's what you'll learn from each section of this tutorial: -- Identify the different components of RStudio. -- Declare variables in R. -- Recognize and use functions. -- Install and load R packages. -- Load and subset tabular data using tidyverse. -- Use the `help` function in R console to troubleshoot and identify required arguments for a given function +A Tour of RStudio: - -## A Tour of RStudio -By the end of this section, you will be able to: - Name the three panes in RStudio and what they do - Change the sizes of the panes - Navigate through the console using common keyboard shortcuts - Change the appearance of RStudio + +RStudio Projects: + +- List the benefits of using RStudio Projects +- Create a new RStudio Project +- Open or switch to an existing RStudio Project + +R Scripts: + +- Create an R script file +- List the benefits of using R scripts +- Annotate R scripts with comments + +Variables in R: + +- Declare variables +- Perform operations to change the value of variables + +Functions in R: + +- Explain what functions and arguments are +- Use R to understand how any given function works +- Identify required and optional arguments for functions + +R Packages: + +- Understand what R packages are and how they are used +- Install and load packages + +Working with Data: + +- Load data into R +- Save loaded data in the environment + +## A Tour of RStudio + When you start RStudio, you will see something like the following window appear: ![](/images/rstudio.png){width=100%} @@ -58,18 +86,16 @@ To change the look of RStudio, you can go to Tools → Global Options → You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. ```{r Tour, echo=FALSE} -question("Which pane enables you to manage R packages?", +quiz( + question("Which pane enables you to manage R packages?", answer("The console"), answer("Lower right pane", correct=TRUE), - answer("Upper right pane") + answer("Upper right pane")) ) ``` ## RStudio Projects -By the end of this section, you will be able to: -- List the benefits of using RStudio Projects -- Create a new RStudio Project -- Open or switch to an existing RStudio Project + When you create a project, RStudio creates an `.Rproj` file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like `/Users//Desktop/`). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in `.RData` so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps. RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labeled "Project: (None)", initially.) @@ -91,17 +117,43 @@ You can open this project in the future in one of three ways: corner of RStudio ```{r Projects, echo=FALSE} -question("What is not a benefit of using RStudio projects?", +quiz( + question("What is not a benefit of using RStudio projects?", answer("All of your files and outputs are linked to the project directory"), answer("R automatically looks for files in the project directory so you don't have to specify a full file path"), - answer("When you reopen a project, your code is saved so all you need to do is rerun it", correct=TRUE) + answer("When you reopen a project, your code is saved so all you need to do is rerun it", correct=TRUE)) +) +``` + +## R Scripts + +R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R's primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results. + +Generally, if you are testing an operation (*e.g.* what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (*e.g.* I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use. + +Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the `#` symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does. + +Let's create an R script (File > New File > R Script) and save it as `tidyverse.R` in your main project directory. If you again look to the project directory on your computer, you will see `tidyverse.R` is now saved there. + +We can copy and paste the previous commands in this tutorial and aggregate it in our R script. + +```{r Scripts, echo=FALSE} +quiz( + question("How do R scripts make your work reproducible?", + answer("Trick question: they work just like Excel and don't make work reproducible"), + answer("They keep a record of all actions done to get from raw data to final results", correct=TRUE), + answer("You can use them to test different operations on your data") +), + + question("How do you annotate R scripts with comments?", + answer("You start the line with 'comment:'"), + answer("You start the line with the # symbol", correct=TRUE), + answer("You can just start typing and R will know it's a comment automatically")) ) ``` ## Variables in R -By the end of this section, you will be able to: -- Declare variables -- Perform operations to change the value of variables + We use variables to store data that we want to access or manipulate later. Variables must have unique names. Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use: @@ -137,7 +189,7 @@ total <- total - 1 total ``` -Now it's your turn! Declare a variable "product" and set its value to 3 * 5. Next, operating on "product", declare a variable called "difference", whose final value is 8. +Now it's your turn! Declare a variable "product" and set its value to the product of the numbers 3 and 5. Next, using the variable "product", declare a variable called "difference", whose final value is 8. ```{r product, exercise=TRUE} # First declare "product" @@ -163,9 +215,10 @@ product <- 3 * 5 difference <- product - 7 ``` -## Functions -By the end of this section, you will be able to: -- Explain what functions and arguments are +## Functions in R + +### Overview + Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): `function(argument1 = ..., argument2 = ..., ...)` @@ -186,34 +239,97 @@ If you instead pass text as arguments to `sum()` you will receive an error: sum("Sum", "does", "not", "accept", "text!") ``` -The use of functions isn't limited to mathematical calculations. Function can also be used to transform data. +On the other hand, the function `paste()`, which links together words, does accept text as arguments. -For example, the function `t()` can be used to transpose a matrix. In the example below, we generate a matrix (`example_matrix`) using the functions `c()` and `as.matrix()`, which were used to combine values into a vector and transform the vector into a matrix. We then use the `t()` function to transpose `example_matrix` into the matrix `example_transposed`. - -```{r t_function, exercise=TRUE} -# Generate Matrix -example_list <- c("T", "does", "accept", "text!") -example_matrix <- as.matrix(example_list) - -#Transpose Matrix -example_transposed <- t(example_matrix) - -#Display Original and Transposed Matrices -example_matrix -example_transposed +```{r paste_function, exercise=TRUE} +paste("Hello", "world", sep = " ") ``` ```{r Functions, echo=FALSE} -question("True or False: Functions accept inputs of all types", +quiz( + question("True or False: Functions accept inputs of all types", answer("True"), - answer("False", correct=TRUE) + answer("False", correct=TRUE)) ) ``` +### Getting Help + +You can get help with any function in R by inputting `?function_name` into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code. + +```{r eval = FALSE} +?read_delim +``` + +The **Description** section tells us that `read_delim()` is a general case of the function we used, `read_csv()`, and `read_tsv()`. + +The **Usage** section tells us the inputs that need to be specified and default inputs of read_delim: + +- `file` and `delim` need to be specified as they are not followed by `=` +- all other parameters have a default value e.g. `quote = "\"` and do not have to be specified to run the function. + +The **Arguments** Section describes the requirements of each input argument in detail. + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. + +Another example from base R that may be widely used is the function `nrow()` + +```{r eval = FALSE} +?nrow +``` + +The **Description** section tells us that `nrow()` from a matrix or an array. + +The **Usage** section tells us the inputs that need to be specified and default inputs of `nrow()`: + +- `x` is the data matrix or array for which the user is interested in identifying the number of rows + +The **Arguments** Section describes the requirements of each input argument in detail. + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. + + + +Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be `select()` + +```{r eval = FALSE} +if (!require("tidyverse")) install.packages("tidyverse") +library(tidyverse) +?select +``` + +The **Description** section tells us that `select()` can be used to select certain columns from a parent dataset, or optionally rename the columns + +The **Overview of selection features** section provides the user a list of operators and selection helpers to fully realize the power of `select()` + +The **Usage** section tells us the inputs that need to be specified and default inputs of `select()` + +- `.data` is a mandatory input which refers to the parent dataset or tibble to subset from +- the helper functions and list of operators could be used to specify the columns to subset + +The **Value** section describes an object integral to `select()`. A more descriptive account can be read in the help section + +The **Method** section describes the implementation method of the function `select()` + +The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. + +```{r Help, echo=FALSE} +quiz( +question("How would you launch a help section for a given function", + answer("Place an exclamation mark in front of the function"), + answer("Place an question mark in front of the function", correct = TRUE), + answer("Place an question mark after of the function"), + answer("Type out help and function name in the console") +), + +question("What does an = sign indicate in the help section", + answer("There exists a default and is not mandatory", correct = TRUE), + answer("Is a mandatory input in the function") +)) +``` + ## R packages -By the end of this section, you will be able to: -- Understand what R packages are and how they are used -- Install and load packages + The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to "open" the package by loading it. ### Installing Packages @@ -249,16 +365,14 @@ You can then use the function `BiocManager::install()` to install a Bioconductor Sometimes two packages include functions with the same name. A common example is that a `select()` function is included both in the `dplyr` and `MASS` packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: `package::function()`. ```{r Packages, echo=FALSE} -question("True or False: Packages are installed once, but loaded every time", +quiz( + question("True or False: Packages are installed once, but loaded every time", answer("True", correct=TRUE), answer("False") -) +)) ``` ## Working with data -By the end of this section, you will be able to: -- Load data into R -- Save loaded data in the environment ### Data description @@ -296,109 +410,3 @@ Since we want to do more with our data after reading it in, we need to save it a ```{r eval = FALSE} OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE) ``` - -## Getting Help -By the end of this section, you will be able to: -- Use R to understand how any given function works -- Identify required and optional arguments for functions - -You can get help with any function in R by inputting `?function_name` into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code. - -```{r eval = FALSE} -?read_delim -``` - -The **Description** section tells us that `read_delim()` is a general case of the function we used, `read_csv()`, and `read_tsv()`. - -The **Usage** section tells us the inputs that need to be specified and default inputs of read_delim: - -- `file` and `delim` need to be specified as they are not followed by `=` -- all other parameters have a default value e.g. `quote = "\"` and do not have to be specified to run the function. - -The **Arguments** Section describes the requirements of each input argument in detail. - -The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. - -Another example from base R that may be widely used is the function `nrow()` - -```{r eval = FALSE} -?nrow -``` - -The **Description** section tells us that `nrow()` from a matrix or an array. - -The **Usage** section tells us the inputs that need to be specified and default inputs of `nrow()`: - -- `x` is the data matrix or array for which the user is interested in identifying the number of rows - -The **Arguments** Section describes the requirements of each input argument in detail. - -The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. - - - -Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be `select()` - -```{r eval = FALSE} -if (!require("tidyverse")) install.packages("tidyverse") -library(tidyverse) -?select -``` - -The **Description** section tells us that `select()` can be used to select certain columns from a parent dataset, or optionally rename the columns - -The **Overview of selection features** section provides the user a list of operators and selection helpers to fully realize the power of `select()` - -The **Usage** section tells us the inputs that need to be specified and default inputs of `select()` - -- `.data` is a mandatory input which refers to the parent dataset or tibble to subset from -- the helper functions and list of operators could be used to specify the columns to subset - -The **Value** section describes an object integral to `select()`. A more descriptive account can be read in the help section - -The **Method** section describes the implementation method of the function `select()` - -The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. - -```{r Help, echo=FALSE} -question("How would you launch a help section for a given function", - answer("Place an exclamation mark in front of the function"), - answer("Place an question mark in front of the function", correct = TRUE), - answer("Place an question mark after of the function"), - answer("Type out help and function name in the console") -) - -question("What does an = sign indicate in the help section", - answer("There exists a default and is not mandatory", correct = TRUE), - answer("Is a mandatory input in the function") -) -``` - -## R Scripts -By the end of this section, you will be able to: -- Create an R script file -- List the benefits of using R scripts -- Annotate R scripts with comments -R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R's primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results. - -Generally, if you are testing an operation (*e.g.* what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (*e.g.* I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use. - -Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the `#` symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does. - -Let's create an R script (File > New File > R Script) and save it as `tidyverse.R` in your main project directory. If you again look to the project directory on your computer, you will see `tidyverse.R` is now saved there. - -We can copy and paste the previous commands in this tutorial and aggregate it in our R script. - -```{r Scripts, echo=FALSE} -question("How do R scripts make your work reproducible?", - answer("Trick question: they work just like Excel and don't make work reproducible"), - answer("They keep a record of all actions done to get from raw data to final results", correct=TRUE), - answer("You can use them to test different operations on your data") -) - -question("How do you annotate R scripts with comments?", - answer("You start the line with 'comment:'"), - answer("You start the line with the # symbol", correct=TRUE), - answer("You can just start typing and R will know it's a comment automatically") -) -``` diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index 84ec6a3..5d767bc 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -119,19 +119,51 @@

Learning objectives

-

By the end of this tutorial you should be able to:

+

Here’s what you’ll learn from each section of this tutorial:

+

A Tour of RStudio:

    -
  • Identify the different components of RStudio.
  • -
  • Declare variables in R.
  • -
  • Recognize and use functions.
  • -
  • Install and load R packages.
  • -
  • Load and subset tabular data using tidyverse.
  • -
  • Use the help function in R console to troubleshoot and identify required arguments for a given function
  • +
  • Name the three panes in RStudio and what they do
  • +
  • Change the sizes of the panes
  • +
  • Navigate through the console using common keyboard shortcuts
  • +
  • Change the appearance of RStudio
  • +
+

RStudio Projects:

+
    +
  • List the benefits of using RStudio Projects
  • +
  • Create a new RStudio Project
  • +
  • Open or switch to an existing RStudio Project
  • +
+

R Scripts:

+
    +
  • Create an R script file
  • +
  • List the benefits of using R scripts
  • +
  • Annotate R scripts with comments
  • +
+

Variables in R:

+
    +
  • Declare variables
  • +
  • Perform operations to change the value of variables
  • +
+

Functions in R:

+
    +
  • Explain what functions and arguments are
  • +
  • Use R to understand how any given function works
  • +
  • Identify required and optional arguments for functions
  • +
+

R Packages:

+
    +
  • Understand what R packages are and how they are used
  • +
  • Install and load packages
  • +
+

Working with Data:

+
    +
  • Load data into R
  • +
  • Save loaded data in the environment

A Tour of RStudio

-

By the end of this section, you will be able to: - Name the three panes in RStudio and what they do - Change the sizes of the panes - Navigate through the console using common keyboard shortcuts - Change the appearance of RStudio When you start RStudio, you will see something like the following window appear:

+

When you start RStudio, you will see something like the following window appear:

Notice that the window has three “panes”:

    @@ -140,18 +172,18 @@

    A Tour of RStudio

  • Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages.

To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane.

-
-
-
-
-
+

Quiz
+
+
+
+
-
+

RStudio Projects

-

By the end of this section, you will be able to: - List the benefits of using RStudio Projects - Create a new RStudio Project - Open or switch to an existing RStudio Project When you create a project, RStudio creates an .Rproj file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like /Users/<username>/Desktop/). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in .RData so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps.

+

When you create a project, RStudio creates an .Rproj file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like /Users/<username>/Desktop/). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in .RData so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps.

RStudio has a simple interface to create and switch between projects, accessed from the button in the top-right corner of the RStudio window. (Labeled “Project: (None)”, initially.)

Let’s create a project to work in for this tutorial. Start by clicking the “Project” button in the upper right or going to the “File” menu. Select “New Project”, and the following will appear:

@@ -163,18 +195,41 @@

RStudio Projects

  • In an open RStudio window, choose “File” → “Open Project”
  • Switch among projects by clicking on the R project symbol in the upper left corner of RStudio
  • -
    -
    -
    -
    -
    +

    Quiz
    +
    +
    +
    +
    +

    +
    +

    R Scripts

    +

    R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R’s primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results.

    +

    Generally, if you are testing an operation (e.g. what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (e.g. I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use.

    +

    Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the # symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does.

    +

    Let’s create an R script (File > New File > R Script) and save it as tidyverse.R in your main project directory. If you again look to the project directory on your computer, you will see tidyverse.R is now saved there.

    +

    We can copy and paste the previous commands in this tutorial and aggregate it in our R script.

    +

    Quiz
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +

    Variables in R

    -

    By the end of this section, you will be able to: - Declare variables - Perform operations to change the value of variables We use variables to store data that we want to access or manipulate later. Variables must have unique names.

    +

    We use variables to store data that we want to access or manipulate later. Variables must have unique names.

    Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use:

    2 + 2 
    @@ -227,9 +282,11 @@

    Variables in R

    difference <- product - 7
    -
    -

    Functions

    -

    By the end of this section, you will be able to: - Explain what functions and arguments are Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where function() is the name of the function and arguments are the different parameters you can specify (i.e. your input):

    +
    +

    Functions in R

    +
    +

    Overview

    +

    Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where function() is the name of the function and arguments are the different parameters you can specify (i.e. your input):

    function(argument1 = ..., argument2 = ..., ...)

    You can treat functions as a black box and do not necessarily need to know how it works under the hood as long as your provided input conforms to a specific format.

    @@ -243,33 +300,75 @@

    Functions

    sum("Sum", "does", "not", "accept", "text!")
    -

    The use of functions isn’t limited to mathematical calculations. Function can also be used to transform data.

    -

    For example, the function t() can be used to transpose a matrix. In the example below, we generate a matrix (example_matrix) using the functions c() and as.matrix(), which were used to combine values into a vector and transform the vector into a matrix. We then use the t() function to transpose example_matrix into the matrix example_transposed.

    -
    -
    # Generate Matrix
    -example_list <- c("T", "does", "accept", "text!")
    -example_matrix <- as.matrix(example_list)
    -
    -#Transpose Matrix
    -example_transposed <- t(example_matrix)
    -
    -#Display Original and Transposed Matrices
    -example_matrix
    -example_transposed
    +

    On the other hand, the function paste(), which links together words, does accept text as arguments.

    +
    +
    paste("Hello", "world", sep = " ")
    -
    -
    -
    -
    -
    +

    Quiz
    +
    +
    +
    +
    +

    +
    +
    +

    Getting Help

    +

    You can get help with any function in R by inputting ?function_name into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code.

    +
    ?read_delim
    +

    The Description section tells us that read_delim() is a general case of the function we used, read_csv(), and read_tsv().

    +

    The Usage section tells us the inputs that need to be specified and default inputs of read_delim:

    +
      +
    • file and delim need to be specified as they are not followed by =
    • +
    • all other parameters have a default value e.g. quote = "\" and do not have to be specified to run the function.
    • +
    +

    The Arguments Section describes the requirements of each input argument in detail.

    +

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    +

    Another example from base R that may be widely used is the function nrow()

    +
    ?nrow
    +

    The Description section tells us that nrow() from a matrix or an array.

    +

    The Usage section tells us the inputs that need to be specified and default inputs of nrow():

    +
      +
    • x is the data matrix or array for which the user is interested in identifying the number of rows
    • +
    +

    The Arguments Section describes the requirements of each input argument in detail.

    +

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    +

    Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be select()

    +
    if (!require("tidyverse")) install.packages("tidyverse")
    +library(tidyverse)
    +?select
    +

    The Description section tells us that select() can be used to select certain columns from a parent dataset, or optionally rename the columns

    +

    The Overview of selection features section provides the user a list of operators and selection helpers to fully realize the power of select()

    +

    The Usage section tells us the inputs that need to be specified and default inputs of select()

    +
      +
    • .data is a mandatory input which refers to the parent dataset or tibble to subset from
    • +
    • the helper functions and list of operators could be used to specify the columns to subset
    • +
    +

    The Value section describes an object integral to select(). A more descriptive account can be read in the help section

    +

    The Method section describes the implementation method of the function select()

    +

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    +

    Quiz
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +

    R packages

    -

    By the end of this section, you will be able to: - Understand what R packages are and how they are used - Install and load packages The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to “open” the package by loading it.

    +

    The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to “open” the package by loading it.

    Installing Packages

    In this tutorial, we will be using the “tidyverse” package. This package contains a versatile set of functions designed for easy manipulation of data.

    @@ -286,19 +385,18 @@

    Loading packages

    install.packages("BiocManager") library("BiocManager)

    You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

    BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

    -
    -
    -
    -
    -
    +

    Quiz
    +
    +
    +
    +
    -
    +

    Working with data

    -

    By the end of this section, you will be able to: - Load data into R - Save loaded data in the environment

    Data description

    The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia.

    @@ -321,90 +419,7 @@

    Loading tabular data

    Save data in the environment

    Since we want to do more with our data after reading it in, we need to save it as a variable in R as we did previously with the <- operator. You can choose to name the object whatever you like, though this module assumes the names used below.

    OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE)
    -
    -
    -
    -

    Getting Help

    -

    By the end of this section, you will be able to: - Use R to understand how any given function works - Identify required and optional arguments for functions

    -

    You can get help with any function in R by inputting ?function_name into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code.

    -
    ?read_delim
    -

    The Description section tells us that read_delim() is a general case of the function we used, read_csv(), and read_tsv().

    -

    The Usage section tells us the inputs that need to be specified and default inputs of read_delim:

    -
      -
    • file and delim need to be specified as they are not followed by =
    • -
    • all other parameters have a default value e.g. quote = "\" and do not have to be specified to run the function.
    • -
    -

    The Arguments Section describes the requirements of each input argument in detail.

    -

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    -

    Another example from base R that may be widely used is the function nrow()

    -
    ?nrow
    -

    The Description section tells us that nrow() from a matrix or an array.

    -

    The Usage section tells us the inputs that need to be specified and default inputs of nrow():

    -
      -
    • x is the data matrix or array for which the user is interested in identifying the number of rows
    • -
    -

    The Arguments Section describes the requirements of each input argument in detail.

    -

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    -

    Tidyverse is a wrapper for many valuable functions widely used in R. One of the examples from Tidyverse would be select()

    -
    if (!require("tidyverse")) install.packages("tidyverse")
    -library(tidyverse)
    -?select
    -

    The Description section tells us that select() can be used to select certain columns from a parent dataset, or optionally rename the columns

    -

    The Overview of selection features section provides the user a list of operators and selection helpers to fully realize the power of select()

    -

    The Usage section tells us the inputs that need to be specified and default inputs of select()

    -
      -
    • .data is a mandatory input which refers to the parent dataset or tibble to subset from
    • -
    • the helper functions and list of operators could be used to specify the columns to subset
    • -
    -

    The Value section describes an object integral to select(). A more descriptive account can be read in the help section

    -

    The Method section describes the implementation method of the function select()

    -

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    -

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -

    -
    -
    -

    R Scripts

    -

    By the end of this section, you will be able to: - Create an R script file - List the benefits of using R scripts - Annotate R scripts with comments R script files are the primary way in which R facilitates reproducible research. They contain the code that loads your raw data, cleans it, performs the analyses, and creates and saves visualizations. R scripts maintain a record of everything that is done to the raw data to reach the final result. That way, it is very easy to write up and communicate your methods because you have a document listing the precise steps you used to conduct your analyses. This is one of R’s primary advantages compared to traditional tools like Excel, where it may be unclear how to reproduce the results.

    -

    Generally, if you are testing an operation (e.g. what would my data look like if I applied a log-transformation to it?), you should do it in the console (left pane of RStudio). If you are committing a step to your analysis (e.g. I want to apply a log-transformation to my data and then conduct the rest of my analyses on the log-transformed data), you should add it to your R script so that it is saved for future use.

    -

    Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the # symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does.

    -

    Let’s create an R script (File > New File > R Script) and save it as tidyverse.R in your main project directory. If you again look to the project directory on your computer, you will see tidyverse.R is now saved there.

    -

    We can copy and paste the previous commands in this tutorial and aggregate it in our R script.

    -

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -

    -
    -
    -
    -
    -
    - -
    -
    + + + + + - - - - - -
    +
    @@ -550,7 +562,7 @@

    R Scripts

    Michelle Kang (adapted from Dr. Kim Dill-McFarland)

    -

    version October 22, 2020

    +

    version October 24, 2020

    From d5f518b2f23819bb62dad7926a2d0263468b5ebe Mon Sep 17 00:00:00 2001 From: cathy-y Date: Sat, 31 Oct 2020 08:04:47 -0700 Subject: [PATCH 08/20] Update r_and_rstudio_basic.html --- .../r_and_rstudio_basic.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index 5d767bc..d0375fe 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -258,7 +258,7 @@

    Variables in R

    total
    -

    Now it’s your turn! Declare a variable “product” and set its value to 3 * 5. Next, operating on “product”, declare a variable called “difference”, whose final value is 8.

    +

    Now it’s your turn! Declare a variable “product” and set its value to the product of the numbers 3 and 5. Next, using the variable “product”, declare a variable called “difference”, whose final value is 8.

    # First declare "product"
     product
    @@ -445,19 +445,19 @@ 

    Save data in the environment

    +
    +
    +
    +
    +
    + +

    +

    RStudio Projects

    When you create a project, RStudio creates an .Rproj file that links all of your files and outputs to the project directory. When you import data from a file, R automatically looks for it in the project directory instead of you having to specify a full file path on your computer (like /Users/<username>/Desktop/). R also automatically saves any output to the project directory. Finally, projects allow you to save your R environment in .RData so that when you close RStudio and then re-open it, you can start right where you left off without re-importing any data or re-calculating any intermediate steps.

    @@ -195,14 +207,6 @@

    RStudio Projects

  • In an open RStudio window, choose “File” → “Open Project”
  • Switch among projects by clicking on the R project symbol in the upper left corner of RStudio
  • -

    Quiz
    -
    -
    -
    -
    - -
    -

    R Scripts

    @@ -211,21 +215,6 @@

    R Scripts

    Additionally, you should annotate your R scripts with comments. In each line of code, any text preceded by the # symbol will not execute. Comments can be useful to remind yourself and to tell other readers what a specific chunk of code does.

    Let’s create an R script (File > New File > R Script) and save it as tidyverse.R in your main project directory. If you again look to the project directory on your computer, you will see tidyverse.R is now saved there.

    We can copy and paste the previous commands in this tutorial and aggregate it in our R script.

    -

    Quiz
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -

    Variables in R

    @@ -281,6 +270,31 @@

    Variables in R

    # Operate on "product" to get 8 as the value for "difference" difference <- product - 7
    +
    +

    Check your Understanding

    +

    Without running the code below, what is the final value of x?

    +
    +
    x <- 5
    +y <- 2
    +x <- y * x
    +y <- x - 4
    + +
    +
    quiz(
    +  question("What is the final value of x?",
    +    answer("5"),
    +    answer("10", correct=TRUE),
    +    answer("6"))
    +)
    +

    Quiz
    +
    +
    +
    +
    + +
    +

    +

    Functions in R

    @@ -445,19 +459,11 @@

    Save data in the environment

    - - - - + + + + @@ -562,7 +579,7 @@

    Save data in the environment

    Michelle Kang (adapted from Dr. Kim Dill-McFarland)

    -

    version October 27, 2020

    +

    version October 31, 2020

    From 2187691631e26760a6606faedecf7412366e0ea9 Mon Sep 17 00:00:00 2001 From: cathy-y Date: Sat, 31 Oct 2020 09:32:34 -0700 Subject: [PATCH 10/20] Question revisions --- .../r_and_rstudio_basic.Rmd | 2 +- .../r_and_rstudio_basic.html | 61 +++++++++---------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index c76318e..e5f34f8 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -204,7 +204,7 @@ product <- 3 * 5 difference <- product - 7 ``` -### Check your Understanding +### Check Your Understanding Without running the code below, what is the final value of x? diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index b895afc..415bf1a 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -280,12 +280,6 @@

    Check your Understanding

    y <- x - 4
    -
    quiz(
    -  question("What is the final value of x?",
    -    answer("5"),
    -    answer("10", correct=TRUE),
    -    answer("6"))
    -)

    Quiz
    @@ -319,14 +313,6 @@

    Overview

    paste("Hello", "world", sep = " ")
    -

    Quiz
    -
    -
    -
    -
    - -
    -

    Getting Help

    @@ -363,18 +349,26 @@

    Getting Help

    The Value section describes an object integral to select(). A more descriptive account can be read in the help section

    The Method section describes the implementation method of the function select()

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    +
    +
    +

    Check Your Understanding

    +

    Here is the help page for the function mean():

    +

    Quiz
    -
    -
    -
    -
    +
    +
    +
    +
    -
    -
    -
    -
    -
    +

    +

    When trying to find the mean of x, NA is the output:

    +

    +

    Quiz
    +
    +
    +
    +

    @@ -399,6 +393,11 @@

    Loading packages

    install.packages("BiocManager") library("BiocManager)

    You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

    BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

    +
    +
    +

    Check Your Understanding

    +

    After installing the dplyr package, you encounter this error:

    +

    Quiz
    @@ -459,11 +458,11 @@

    Save data in the environment

    - -
    -

    -
    -
    -
    -

    Working with data

    -
    -

    Data description

    -

    The data used throughout this module were collected as part of an on-going oceanographic time-series program in Saanich Inlet, a seasonally anoxic fjord on the East coast of Vancouver Island, British Columbia.

    -

    The data that you will use in R are 16S rRNA amplicon profiles of microbial communities at several depths in Saanich Inlet from one time-point in this series (August 2012). These ~300 bp sequences were processed using mothur to yield 97% (approximately species-level) operational taxonomic units (OTUs).

    -

    Saanich_OTU_metadata.csv is a comma-delimited table of counts of four OTUs in each sample, normalized to 100,000 sequences per sample and the corresponding conditions of each sample (Depth, NO2, NO3 etc.).

    -

    For a brief introduction to these data, see Hallam SJ et al. 2017. Monitoring microbial responses to ocean deoxygenation in a model oxygen minimum zone. Sci Data 4: 170158 doi:10.1038/sdata.2017.158.

    -
    -
    -

    Loading tabular data

    -

    Tabular data can be loaded into R using the tidyverse read_* functions, which generate data frames. Each row in a data frame represents one observation, and each column represents one variable.

    -

    in your file browser, create a data directory in your project directory. Download the Saanich_OTU_metadata.csv file and save it in your data directory.

    -

    For example, we can load our Saanich data into R with read_csv for a comma-separated file and specify the arguments that describe our data as follows:

    -
      -
    • file: the name of the file you want to load
    • -
    • col_names: can take either the value TRUE or FALSE and tells R if the first row contains column names
    • -
    -
    read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE)
    -
    -
    -

    Save data in the environment

    -

    Since we want to do more with our data after reading it in, we need to save it as a variable in R as we did previously with the <- operator. You can choose to name the object whatever you like, though this module assumes the names used below.

    -
    OTU_metadata_table <- read_csv(file="data/Saanich_OTU_metadata.csv", col_names = TRUE)
    - +
    +

    Quiz
    @@ -213,6 +217,8 @@

    R Scripts

    Variables in R

    +
    +

    Defining Variables

    We use variables to store data that we want to access or manipulate later. Variables must have unique names.

    Without declaring a variable the sum of these two numbers will be printed to console but cannot be accessed for future use:

    @@ -242,7 +248,7 @@

    Variables in R

    total
    -

    Now it’s your turn! Declare a variable “product” and set its value to the product of the numbers 3 and 5. Next, using the variable “product”, declare a variable called “difference”, whose final value is 8.

    +

    Now it’s your turn! Declare a variable product and set its value to the product of the numbers 3 and 5. Next, using the variable product, declare a variable called difference, whose final value is 8.

    # First declare "product"
     product
    @@ -265,9 +271,10 @@ 

    Variables in R

    # Operate on "product" to get 8 as the value for "difference" difference <- product - 7
    +

    Check Your Understanding

    -

    Without running the code below, what is the final value of x?

    +

    Without running the code below, what is the final value of x?

    x <- 5
     y <- 2
    @@ -309,6 +316,47 @@ 

    Overview

    +
    +

    Data Types in R

    +

    You’ve seen that paste() operates on text while sum() does not. In other words, different functions accept different data types. In this section, we’ll cover three basic data types: numeric, character, and logical. The function class() tells you what the variable’s type is.

    +

    Run the code below:

    +
    +
    y <- 4
    +class(y)
    + +
    +

    As you can see, numbers are of type numeric. Now, run the next code block. Is the output the same? If not, what changed?

    +
    +
    z <- "4"
    +class(z)
    + +
    +

    When you put numbers and letters in quotations, the variable they’re assigned to is of type character. If you write text without quotes, however, R assumes you’re referring to a variable. Can you change the code so that it runs without errors?

    +
    +
    a <- hello
    +a
    + +
    +
    +
    a <- "hello"
    +a
    +
    +

    The last data type we’ll cover is logical, which takes on the values of TRUE or FALSE. They are the outputs of logical statements:

    +
    +
    0 < 1 # smaller than
    +0 >= 0 # larger-or-equal to
    +5 == 7.1 # equal to. Note TWO equal symbols.
    +"cat" == "dog" # you can also use this symbol to compare text
    +5 != pi # not equal to
    + +
    +

    Below, write two logical statements using the template, one evaluating to TRUE and the other to FALSE.

    +
    +
    # ... <= ...
    +# ... == ...
    + +
    +

    Getting Help

    You can get help with any function in R by inputting ?function_name into the Console. This will open a window in the bottom right under the Help tab with information on that function, including input options and example code.

    @@ -347,8 +395,14 @@

    Getting Help

    Check Your Understanding

    -

    Here is the help page for the function mean():

    -

    +

    Pull up the help page for the function mean()

    +
    +
    # your code here
    + +
    +
    +
    ?mean
    +

    Quiz
    @@ -357,16 +411,6 @@

    Check Your Understanding

    -

    When trying to find the mean of x, NA is the output:

    -

    -

    Quiz
    -
    -
    -
    -
    - -
    -

    @@ -426,11 +470,18 @@

    Check Your Understanding

    + + + + + + + + + + + + @@ -542,7 +631,7 @@

    Check Your Understanding

    Michelle Kang (adapted from Dr. Kim Dill-McFarland)

    -

    version November 03, 2020

    +

    version November 07, 2020

    From 88bf4307e7af9f6702d9e687076a322c8b9dcd3e Mon Sep 17 00:00:00 2001 From: Cathy <59323254+cathy-y@users.noreply.github.com> Date: Mon, 9 Nov 2020 10:45:34 -0800 Subject: [PATCH 14/20] Update inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd Co-authored-by: Ryan Karimi <66281159+r-karimi@users.noreply.github.com> --- inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index d0010ec..c4bf688 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -359,7 +359,7 @@ The **Value** section describes an object integral to `select()`. A more descrip The **Method** section describes the implementation method of the function `select()` -The **Examples** Section has examples of the function that can be directly copy and pasted into your terminal and ran. +The **Examples** Section has examples of the function that can be directly copied and pasted into your terminal and run. ### Check Your Understanding From 9c93172579e7edf1f48f327786fa2a7dd66cca86 Mon Sep 17 00:00:00 2001 From: cathy-y Date: Sun, 15 Nov 2020 08:52:36 -0800 Subject: [PATCH 15/20] Added section on vectors and data frames, covered logical operators in greater depth, gave examples of common errors for loading and installing packages --- DESCRIPTION | 2 +- inst/resources/images/dependerror.png | Bin 0 -> 24887 bytes inst/resources/images/packageinstall.png | Bin 0 -> 50469 bytes .../r_and_rstudio_basic.Rmd | 151 +++++++++++- .../r_and_rstudio_basic.html | 222 ++++++++++++++++-- 5 files changed, 352 insertions(+), 23 deletions(-) create mode 100644 inst/resources/images/dependerror.png create mode 100644 inst/resources/images/packageinstall.png diff --git a/DESCRIPTION b/DESCRIPTION index 39cfea1..0f03f1c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,4 +19,4 @@ Imports: learnr, readr, shiny -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 diff --git a/inst/resources/images/dependerror.png b/inst/resources/images/dependerror.png new file mode 100644 index 0000000000000000000000000000000000000000..bc8007fc83a81f5c0d294f0b82bbadd18b67d3b1 GIT binary patch literal 24887 zcmeFZbyU=UobRt7-60(!t#s#*64IhDbVJgsY)cew86RkPVh#<#PiM_j*UOh zyPQRY0-x9x9DfvZaQl1%ADsGkM5fS}as z{j@5~c8$B@amyHwce+ihC7z5TGq}O~H)V5U1C?CTYz5oJ zJZf=oF9B~lF*B@f&&M$0Gd>^u*-}?ucGcqb?pg;vGb*wra@u+;Dp!RzlksD04Z4!O zP3zv1fsY?x5zd&SS&Qwii^qL7TNm7-La%K0wVnYsG$>i}yVFAT+OnX1+!Y=Wsdc9_g8@z&Y;w>9 zQHss6uQhvm{G#0O;bV*13uJak3*(IL6pCPavTil9MOSpV{z$2t1?xBE=<k?)7(W^*c%3Zx#(#t31a^ z)Jc=7K*HUc(^T=q@J&2jDdc3td1iAEWfSxaufhLpjGCPs0Kx2w^?H+9 z`r7fAZU$XvqYplRK#viffrk}d#O=DyhmZPmGGokMEvO7LH)hn!dXpe~U4`F?U8&Vy zdOt-ZW|xZ@3KN`JGYR_yht)SHp8E&6sE5~7HMo;xK~Jgdu~;+E;G0qD=05Kphiy!d z96@5+1&PnTpy4;MsrN+?p&t4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lPciD{lb9a7l4#g%4W-LVGPM$80ebEaek z-{`~|o$X^!?{!A`Cqwy?JRE>k0_bX`sYC*7qIApS)SDKfC3jD!G%J>DcR%EfG<5RN zRaD7F-v<$Ytr92TM6z_S91j>Wy8l z@Q*O6%Z_9In%3-xqRAo*Ahr}8gOhL*Z&bC#vyooCQ<||L+rOOrfpkCoZrerT2E3Gy|0zBD{W@v#55G}9?UQud8786z{_NlvEp`3d JWvaFz{{=E*+!z1= literal 0 HcmV?d00001 diff --git a/inst/resources/images/packageinstall.png b/inst/resources/images/packageinstall.png new file mode 100644 index 0000000000000000000000000000000000000000..651bdeeb8782fbd1d788006104b3aa3a91a87582 GIT binary patch literal 50469 zcmeFZcT`h-_b-T#1(Bwr0@6f8lon~yiDE%OM5Nb<^p1caH7W=S0t!NCf`IhiJ5i*E z-g}480w#e#NI5q_pWpku@0~SsXU)Ac^T*9vl#`tE{qD2-{_K77{_!If##0wh(a_K^ zsy?{;goft$Fb&OLTqpmcyrZLa)SB|=i2D;2Wtzes&Na%xF`L^Ow`pifBI$|d$0^5j zt`7{|X=s>!Qh$!Lxnx_?&@|Vo-o35!(hNm1ExMxanM^lw-euo6^eLC)Q-I~d?X$ET z1h0>rr>`9mU|DtkT32*D>eb0}Ukke&q}GG8f1Ci>8yWMueY2F7OnY*a(I{H6R?cDz zH@~uiD~YY~4f1Wq&fOdC7`w1yjffSIFrJ@BN4o%{&^sr2gH9_S{vy05(*ORCa@f~+ z8F=&OgOj}FMeXoQf1h^}C4>R}RMerwY*^I95 z9>4YG6?U4{Nd6scj;eZ)HJ4DIcGVT}~S%Dnx-jT!o<$?8n z*Clcy9DrW^_iF+2?0J{hc1XzPG`kKV(3AmCt@d?!kWjHSAcSg)^eQdtV%Q9i2)Y)W^ejBJ3QN_tNFc!&VB zHfB@iAHomtffGq!0uLE^C4N9eJ0|BwP0-`tD;Fj}@pZFg42ZmM1K(!q<^vPPw*fQ= zaMr?HlDkK?QoHkcoR7rY2LWE!HO?cU@#G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D#y47jjv?`se2$t*a(b)}c9aGgUc0rurM}24s640bAfSs96@}-@aLR)C=(}s_}yMaOTV3 zg}QV7UH1`ns78Fc%LW6bjvHmvk>d>NU)EK*v~C*U7oLD_!bYy%;U|C$@IO8w54*9N2);57Q?9x=7p1f}S2Nw^nyh&76)U!GU`YgMek|-k3SLP* z>sg`85?733a7dIO2ZG6=bAtWvbr(U7HT1x)Tgpo8QP6YzP(9yPW#4L9d$Vtx@Sl+l zlUW*QiL>guGjVfs`XsqgN@!r{*NZ|dG4>(DpU4u;bdGrHL4A?(a){L%dKwxy%<|Y^ z=(&h*{?z`kmnp!wP+>Cx?9~eiJ&$mN{BAT=E>7nhrNvR##Fm&ws#6(r1Co34dq~I^ zs_S`wWm7i?Xe{fw+q;T95tY55K%<`b)~uVd8U})eWhy2cP8E zOTz}7*xxSxE_;lJQ}z~3xPE3SbU`8(7b2<^V(L6cBc_C%zeLoSsG4M{roTHxjLB3n z`5!w{B8w(cV7z4m2ld~0N*QS7)OI+PuJ_9| znEvePs6KVW7?N;eG57=t8ZCSn3lk|)ZTS6scMnd709)$!uV57A1h{{nG5o)ZK8F1L z0sq%$WpEn%=anySPpbd_+*tm3&i{pT{omvbc~U4q4PC)#w444jY46wpvIJt@!^9r5 z?=kwWZL{?_= 0 # larger-or-equal to @@ -382,6 +398,106 @@ quiz( ) ``` +## Vectors and Data Frames + +### Vectors + +Two basic data structures we'll cover in this tutorial are vectors and data frames. Vectors are essentially lists containing elements of the same data type. They can be created using the `c()` function. + +```{r vector-1, exercise=TRUE} +x <- c(1, 2, 3, 4) # a vector containing numeric data +y <- c("hello", "world") # a vector containing character data +x +y +``` + +You can use the `typeof()` function to check what type of data the vector contains. + +```{r vector-2, exercise=TRUE} +x <- c(1, 2, 3, 4) +y <- c("hello", "world") +typeof(x) +typeof(y) +``` + +Use the `typeof()` function to check what type of data `z` contains. Is it what you expected? + +```{r vector-3, exercise=TRUE} +z <- c(1, 4, "hello") +# your code here +``` + +Since vectors must only contain data of the same type, R performed a process called coercion to turn the numbers into type character. If you print `z` above, you'll see quotation marks around 1 and 4. + +### Data Frames + +Data frames are tables where columns represent variables and rows represent sets of observations. Run the code below to see an example: + +```{r df, include=FALSE} +grades <- data.frame( + name = c("John", "Jane", "Charles", "Amy", "Joe"), + score = c(30, 80, 65, 92, NA), + passing = c(FALSE, TRUE, TRUE, TRUE, NA) +) +``` + +```{r df2, exercise=TRUE} +grades +``` + +In `grades`, we have three columns for the three variables we're interested in: the student's name, their score on an exam, and whether they passed the exam. Each of the five rows represents a set of data collected from a student. Under each column name, the data type of the column is displayed. The three types here are `chr`, or character; `dbl`, a type of numeric data; and `lgl`, or logical. + +What do you notice about the last row? Joe hasn't taken the exam yet, so his score, and consequently his passing status, are missing. `NA` is used to represent missing data in vectors and data frames. It doesn't have an explicit data type, so it can be used in vectors and columns of any type. + +### Check Your Understanding + +Pull up the documentation for `mean()` again. + +```{r mean-help2, exercise=TRUE} +# your code here +``` + +```{r mean-help2-solution} +?mean +``` + +```{r mean1, echo=FALSE} +quiz( + question("Which argument for `mean()` is a vector?", + answer("x", correct=TRUE), + answer("trim"), + answer("na.rm")) +) +``` + +Let's take the mean of 12, 56, 7, and 89. Create a vector with these numbers below and assign it to the variable `x`: + +```{r mean2, exercise=TRUE} +x <- # your code here +mean(x) +``` + +```{r mean2-solution} +x <- c(12, 56, 7, 89) +mean(x) +``` + +Take the mean of `y`. Looking at the documentation for `mean()`, can you modify the code so that the output isn't `NA`? + +```{r mean3, exercise=TRUE} +y <- c(5, 12, 64, 1, NA) +# take the mean of y +``` + +```{r mean3-hint-1, exercise=TRUE} +y <- c(5, 12, 64, 1, NA) +mean(y) +``` + +```{r mean3-solution} +y <- c(5, 12, 64, 1, NA) +mean(y, na.rm=TRUE) +``` ## R packages @@ -397,6 +513,16 @@ You should have already installed the "tidyverse" package using RStudio's graphi install.packages("tidyverse") ``` +When you install a package, you'll see an output like this in the console: + +![](/images/packageinstall.png){width=75%} + +The key part to focus on here is the line, "also installing the dependencies...." Dependencies are other packages that the package you're installing needs to run. Although they're typically installed alongside, you may run into an error or warning message like the one below: + +![](/images/dependerror.png){width=75%} + +This tells you that, for whatever reason, these dependencies were not installed properly and therefore your package either can't be installed or run. The best way to resolve this issue is to install these dependencies using separate `install.packages()` commands. + ### Loading packages After installing a package, and *everytime* you open a new RStudio session, you need to first load (open) the packages you want to use with the `library()` function. This tells R to access the package's functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it. @@ -407,6 +533,14 @@ Packages can be loaded like this: library(tidyverse) ``` +The package `janitor` is used for cleaning up your data. Run the code below to load it: + +```{r ade4, exercise=TRUE, error=TRUE} +library(janitor) +``` + +We got an error because we haven't actually installed the package. Packages need to be installed before they can be loaded. + It is a little tricker to load Bioconductor packages, as they are often not stored on the Comprehensive R Archive Network (CRAN) where most packages live. There is a package, however, that lives on CRAN and serves as an interface between CRAN and the Bioconductor packages. To load a Bioconductor package, you must first install and load the BiocManager package, like so. @@ -421,15 +555,18 @@ Sometimes two packages include functions with the same name. A common example is ### Check Your Understanding -After installing the `dplyr` package, you encounter this error: +After installing the `janitor` package, you want to use the function `get_dupes()` to see if there are any duplicates in your data. -![](/images/selecterror.png){width=100%} +```{r get, exercise=TRUE, error=TRUE} +get_dupes(your_data) +``` ```{r Packages, echo=FALSE} quiz( - question("Why did this happen?", - answer("The function `select()` wasn't installed"), - answer("The package `dplyr` wasn't loaded after installation", correct=TRUE), - answer("The arguments given to `select()` are invalid")) + question("What caused this error?", + answer("The function `get_dupes()` wasn't installed"), + answer("The package `janitor` wasn't loaded after installation", correct=TRUE), + answer("The arguments given to `get_dupes()` are invalid")) ) ``` + diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index 4afd0d5..c1a12c3 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -143,14 +143,20 @@

    Learning objectives

    • Declare variables
    • Perform operations to change the value of variables
    • -
    • Recognize string, numeric, and logical data types

    Functions in R:

    • Explain what functions and arguments are
    • Use R to understand how any given function works
    • +
    • Recognize string, numeric, and logical data types
    • Identify required and optional arguments for functions
    +

    Vectors and Data Frames:

    +
      +
    • Explain what vectors and data frames are
    • +
    • Create vectors
    • +
    • Understand what NAs are
    • +

    R Packages:

    • Understand what R packages are and how they are used
    • @@ -341,7 +347,15 @@

      Data Types in R

      a <- "hello"
       a
    -

    The last data type we’ll cover is logical, which takes on the values of TRUE or FALSE. They are the outputs of logical statements:

    +

    The last data type we’ll cover is logical, which takes on the values of TRUE or FALSE. In addition to being function arguments, they are also the outputs of logical statements. Logical statements use logical operators to compare two elements. You’ve likely seen some of the logical operators before, but here is a list of the basic ones:

    +

    [Place image here]

    +Run the code below. Is it what you expected? Based on the table above, what’s missing? +
    +
    5 = 7
    + +
    +

    In R, to test if two elements are equal, you have to use two equal signs. When you use only one, R assumes you’re trying to assign a value to a variable. We can’t assign 7 to 5, so an error gets thrown.

    +Here are some more logical statements in action:
    0 < 1 # smaller than
     0 >= 0 # larger-or-equal to
    @@ -391,7 +405,7 @@ 

    Getting Help

    The Value section describes an object integral to select(). A more descriptive account can be read in the help section

    The Method section describes the implementation method of the function select()

    -

    The Examples Section has examples of the function that can be directly copy and pasted into your terminal and ran.

    +

    The Examples Section has examples of the function that can be directly copied and pasted into your terminal and run.

    Check Your Understanding

    @@ -413,6 +427,89 @@

    Check Your Understanding

    +
    +

    Vectors and Data Frames

    +
    +

    Vectors

    +

    Two basic data structures we’ll cover in this tutorial are vectors and data frames. Vectors are essentially lists containing elements of the same data type. They can be created using the c() function.

    +
    +
    x <- c(1, 2, 3, 4) # a vector containing numeric data
    +y <- c("hello", "world") # a vector containing character data 
    +x
    +y
    + +
    +

    You can use the typeof() function to check what type of data the vector contains.

    +
    +
    x <- c(1, 2, 3, 4)
    +y <- c("hello", "world") 
    +typeof(x)
    +typeof(y)
    + +
    +

    Use the typeof() function to check what type of data z contains. Is it what you expected?

    +
    +
    z <- c(1, 4, "hello")
    +# your code here
    + +
    +

    Since vectors must only contain data of the same type, R performed a process called coercion to turn the numbers into type character. If you print z above, you’ll see quotation marks around 1 and 4.

    +
    +
    +

    Data Frames

    +

    Data frames are tables where columns represent variables and rows represent sets of observations. Run the code below to see an example:

    +
    +
    grades
    + +
    +

    In grades, we have three columns for the three variables we’re interested in: the student’s name, their score on an exam, and whether they passed the exam. Each of the five rows represents a set of data collected from a student. Under each column name, the data type of the column is displayed. The three types here are chr, or character; dbl, a type of numeric data; and lgl, or logical.

    +

    What do you notice about the last row? Joe hasn’t taken the exam yet, so his score, and consequently his passing status, are missing. NA is used to represent missing data in vectors and data frames. It doesn’t have an explicit data type, so it can be used in vectors and columns of any type.

    +
    +
    +

    Check Your Understanding

    +

    Pull up the documentation for mean() again.

    +
    +
    # your code here
    + +
    +
    +
    ?mean
    +
    +

    Quiz
    +
    +
    +
    +
    + +
    +

    +

    Let’s take the mean of 12, 56, 7, and 89. Create a vector with these numbers below and assign it to the variable x:

    +
    +
    x <- # your code here
    +mean(x)
    + +
    +
    +
    x <- c(12, 56, 7, 89)
    +mean(x)
    +
    +

    Take the mean of y. Looking at the documentation for mean(), can you modify the code so that the output isn’t NA?

    +
    +
    y <- c(5, 12, 64, 1, NA)
    +# take the mean of y
    + +
    +
    +
    y <- c(5, 12, 64, 1, NA)
    +mean(y)
    + +
    +
    +
    y <- c(5, 12, 64, 1, NA)
    +mean(y, na.rm=TRUE)
    +
    +
    +

    R packages

    The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to “open” the package by loading it.

    @@ -421,6 +518,11 @@

    Installing Packages

    In this tutorial, we will be using the “tidyverse” package. This package contains a versatile set of functions designed for easy manipulation of data.

    You should have already installed the “tidyverse” package using RStudio’s graphical interface. Packages can also be installed by entering the function install.packages() in the console (to install a different package just replace “tidyverse” with the name of the desired package):

    install.packages("tidyverse")
    +

    When you install a package, you’ll see an output like this in the console:

    +

    +

    The key part to focus on here is the line, “also installing the dependencies….” Dependencies are other packages that the package you’re installing needs to run. Although they’re typically installed alongside, you may run into an error or warning message like the one below:

    +

    +

    This tells you that, for whatever reason, these dependencies were not installed properly and therefore your package either can’t be installed or run. The best way to resolve this issue is to install these dependencies using separate install.packages() commands.

    Loading packages

    @@ -432,19 +534,28 @@

    Loading packages

    install.packages("BiocManager") library("BiocManager)

    You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

    BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

    +

    The package ade4 is used for statistical analyses. Run the code below to load it:

    +
    +
    library(ade4)
    +
    -
    +
    +

    Check Your Understanding

    -

    After installing the dplyr package, you encounter this error:

    -

    -
    Quiz
    +

    :

    +
    +
    annotate::get("first_argument", second_argument)
    + +
    +

    Quiz
    -
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + @@ -631,7 +823,7 @@

    Check Your Understanding

    Michelle Kang (adapted from Dr. Kim Dill-McFarland)

    -

    version November 07, 2020

    +

    version November 15, 2020

    From 64ffef4b9f583e8d26926246fa04ad4832f1a9fd Mon Sep 17 00:00:00 2001 From: cathy-y Date: Mon, 30 Nov 2020 19:37:45 -0800 Subject: [PATCH 16/20] Started the troubleshooting section --- .../r_and_rstudio_basic.Rmd | 38 +++++++++++++++- .../r_and_rstudio_basic.html | 44 +++++++++++-------- 2 files changed, 62 insertions(+), 20 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index ef95296..2334ab0 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -441,7 +441,7 @@ grades <- data.frame( ) ``` -```{r df2, exercise=TRUE} +```{r df2, exercise=TRUE, exercise.setup="df"} grades ``` @@ -535,7 +535,7 @@ library(tidyverse) The package `janitor` is used for cleaning up your data. Run the code below to load it: -```{r ade4, exercise=TRUE, error=TRUE} +```{r janitor, exercise=TRUE, error=TRUE} library(janitor) ``` @@ -570,3 +570,37 @@ quiz( ) ``` +## Stuck? A Short Guide to Troubleshooting and Getting Help + +If you've been coding for more than an hour, you've definitely had to troubleshoot your code. However, errors can be cryptic, using a new package can be confounding, and, despite your best efforts, you may still end up needing help from someone else. In this section, you'll find a brief, non-exhaustive guide to troubleshooting. + +### Tackling Errors + +RStudio enables debugging via: + +- `traceback()` +- Flagging problematic lines of code + +After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the `traceback()` function to identify the source of the error. To give you an idea of what the output looks like, `traceback()` is used as an error handler in the code below, meaning it will automatically run when an error is encountered. + +```{r traceback, exercise = TRUE, error = TRUE} +options(error = traceback) + +x <- c(1, 2, "three", 4) +y <- c(5, 6, 7, 8) +z <- mean(x) +w <- mean(y) +sum(c(z, w)) +``` + +RStudio also flags problematic lines of code. It's a red dot that appears to the left of your code for lines where something isn't "quite right". Hovering over the red dot provides you with some additional information, but it typically appears when you make a syntax error like forgetting a closing bracket. + +You, of course, can also take steps to troubleshoot. Two best practices are: + +- Printing out intermediates: If you're running one big function you wrote or stringing together several steps in a row, try running each piece one at a time and printing the output to see where the error is occurring. +- Googling the error: Unless you're doing groundbreaking computer science, someone has encountered your error before. Google the error message verbatim and visit forums like Stack Exchange to get crowdsourced troubleshooting tips. + +### Working with New Packages + + + diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index c1a12c3..30d686e 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -458,9 +458,16 @@

    Vectors

    Data Frames

    Data frames are tables where columns represent variables and rows represent sets of observations. Run the code below to see an example:

    +
    +
    grades <- data.frame(
    +  name = c("John", "Jane", "Charles", "Amy", "Joe"),
    +  score = c(30, 80, 65, 92, NA),
    +  passing = c(FALSE, TRUE, TRUE, TRUE, NA)
    +)
    +
    grades
    - +

    In grades, we have three columns for the three variables we’re interested in: the student’s name, their score on an exam, and whether they passed the exam. Each of the five rows represents a set of data collected from a student. Under each column name, the data type of the column is displayed. The three types here are chr, or character; dbl, a type of numeric data; and lgl, or logical.

    What do you notice about the last row? Joe hasn’t taken the exam yet, so his score, and consequently his passing status, are missing. NA is used to represent missing data in vectors and data frames. It doesn’t have an explicit data type, so it can be used in vectors and columns of any type.

    @@ -529,22 +536,23 @@

    Loading packages

    After installing a package, and everytime you open a new RStudio session, you need to first load (open) the packages you want to use with the library() function. This tells R to access the package’s functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it.

    Packages can be loaded like this:

    library(tidyverse)
    +

    The package janitor is used for cleaning up your data. Run the code below to load it:

    +
    +
    library(janitor)
    + +
    +

    We got an error because we haven’t actually installed the package. Packages need to be installed before they can be loaded.

    It is a little tricker to load Bioconductor packages, as they are often not stored on the Comprehensive R Archive Network (CRAN) where most packages live. There is a package, however, that lives on CRAN and serves as an interface between CRAN and the Bioconductor packages.

    To load a Bioconductor package, you must first install and load the BiocManager package, like so.

    install.packages("BiocManager") library("BiocManager)

    You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

    BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

    -

    The package ade4 is used for statistical analyses. Run the code below to load it:

    -
    -
    library(ade4)
    - -

    Check Your Understanding

    -

    :

    +

    After installing the janitor package, you want to use the function get_dupes() to see if there are any duplicates in your data.

    -
    annotate::get("first_argument", second_argument)
    +
    get_dupes(your_data)

    Quiz
    @@ -588,11 +596,11 @@

    Check Your Understanding

    @@ -797,7 +805,7 @@

    Check Your Understanding

    +
    +
    +
    +

    Stuck? A Short Guide to Troubleshooting and Getting Help

    +

    If you’ve been coding for more than an hour, you’ve definitely had to troubleshoot your code. However, errors can be cryptic, using a new package can be confounding, and, despite your best efforts, you may still end up needing help from someone else. In this section, you’ll find a brief, non-exhaustive guide to troubleshooting.

    +
    +

    Tackling Errors

    +

    RStudio enables debugging via:

    +
      +
    • traceback()
    • +
    • Flagging problematic lines of code
    • +
    +

    After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the traceback() function to identify the source of the error.

    +

    RStudio also flags problematic lines of code. It’s a red dot that appears to the left of your code for lines where something isn’t “quite right”. Hovering over the red dot provides you with some additional information, but it typically appears when you make a syntax error like forgetting a closing bracket.

    +

    You, of course, can also take steps to troubleshoot. Two best practices are:

    +
      +
    • Printing out intermediates: If you’re running one big function you wrote or stringing together several steps in a row, try running each piece one at a time and printing the output to see where the error is occurring.
    • +
    • Googling the error: Unless you’re doing groundbreaking computer science, someone has encountered your error before. Google the error message verbatim and visit forums like Stack Exchange to get crowdsourced troubleshooting tips.
    • +
    +
    +
    +

    Working with New Packages

    +

    While ?function_name is helpful when you know which function you want to use, vignettes are what you need when you don’t know where to start. Vignettes are detailed summaries of packages. They go over common workflows and functions, and explain the background and theory behind their implementation. You can search for vignettes with browseVignettes("package_name"); an example is provided below:

    +
    +
    browseVignettes("tidyverse")
    + +
    +

    Running this code will take you to a page listing all of the vignettes available for that package.

    +
    +
    +

    Asking for Help

    +

    When sending your code to someone else for review, it is important to also include:

    +
      +
    • Any files you’re loading in your script
    • +
    • R session info
    • +
    +

    Without the files, the person reviewing your code won’t be able to run your script. Additionally, the function sessionInfo() will generate a report on your operating system, R version, and loaded packages, which helps with troubleshooting.

    +
    +
    sessionInfo()
    + +
    +

    If you know roughly where your error is occurring, you can generate a “reprex” report. Reprex stands for “reproducible example”, and outputs your code and errors in a way that someone else is able to reproduce your results. Using the reprex package, simply run reprex() in the console to generate your report. For best results:

    +
      +
    • Make sure to create all of the relevant variables
    • +
    • Load required packages using library()
    • +
    • Include only the parts of the code related to the error, not the entire script
    • +
    @@ -596,11 +644,11 @@

    Check Your Understanding

    + + + +
    @@ -831,7 +893,7 @@

    Check Your Understanding

    Michelle Kang (adapted from Dr. Kim Dill-McFarland)

    -

    version November 24, 2020

    +

    version December 01, 2020

    From ee6ba8e756a0844b20c9b10f74fd63614fe7fb99 Mon Sep 17 00:00:00 2001 From: cathy-y Date: Sat, 12 Dec 2020 13:03:19 -0800 Subject: [PATCH 19/20] Added internal links --- .../r_and_rstudio_basic.Rmd | 54 +++++----- .../r_and_rstudio_basic.html | 100 +++++++++--------- 2 files changed, 73 insertions(+), 81 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 4a41e9b..5519711 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -88,7 +88,7 @@ Notice that the window has three "panes": To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. -### Check Your Understanding +### Check Your Understanding {#object} The command below is used to display the object `dog`. However, when running it, you get an error. @@ -233,7 +233,7 @@ quiz( ## Functions in R -### Overview +### Overview {#invalid-type} Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): @@ -261,7 +261,7 @@ On the other hand, the function `paste()`, which links together words, does acce paste("Hello", "world", sep = " ") ``` -### Data Types in R +### Data Types in R {#types} You've seen that `paste()` operates on text while `sum()` does not. In other words, different functions accept different data types. In this section, we'll cover three basic data types: numeric, character, and logical. The function `class()` tells you what the variable's type is. @@ -293,16 +293,6 @@ a The last data type we'll cover is logical, which takes on the values of `TRUE` or `FALSE`. In addition to being function arguments, they are also the outputs of logical statements. Logical statements use logical operators to compare two elements. You've likely seen some of the logical operators before, but here is a list of the basic ones: -[Place image here] - -Run the code below. Is it what you expected? Based on the table above, what's missing? -```{r equal, exercise=TRUE, error=TRUE} -5 = 7 -``` - -In R, to test if two elements are equal, you have to use two equal signs. When you use only one, R assumes you're trying to assign a value to a variable. We can't assign 7 to 5, so an error gets thrown. - -Here are some more logical statements in action: ```{r logical, exercise=TRUE} 0 < 1 # smaller than 0 >= 0 # larger-or-equal to @@ -311,6 +301,13 @@ Here are some more logical statements in action: 5 != pi # not equal to ``` +Run the code below. Is it what you expected? Based on the code above, what's missing? +```{r equal, exercise=TRUE, error=TRUE} +5 = 7 +``` + +In R, to test if two elements are equal, you have to use two equal signs. When you use only one, R assumes you're trying to assign a value to a variable. We can't assign 7 to 5, so an error gets thrown. + Below, write two logical statements using the template, one evaluating to `TRUE` and the other to `FALSE`. ```{r logical-statements, exercise=TRUE} @@ -504,7 +501,7 @@ mean(y, na.rm=TRUE) The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to "open" the package by loading it. -### Installing Packages +### Installing Packages {#dependency} In this tutorial, we will be using the "tidyverse" package. This package contains a versatile set of functions designed for easy manipulation of data. @@ -524,7 +521,7 @@ The key part to focus on here is the line, "also installing the dependencies.... This tells you that, for whatever reason, these dependencies were not installed properly and therefore your package either can't be installed or run. The best way to resolve this issue is to install these dependencies using separate `install.packages()` commands. -### Loading packages +### Loading packages {#no-package} After installing a package, and *everytime* you open a new RStudio session, you need to first load (open) the packages you want to use with the `library()` function. This tells R to access the package's functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it. @@ -554,7 +551,7 @@ You can then use the function `BiocManager::install()` to install a Bioconductor `BiocManager::install("annotate")` Sometimes two packages include functions with the same name. A common example is that a `select()` function is included both in the `dplyr` and `MASS` packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: `package::function()`. -### Check Your Understanding +### Check Your Understanding {#no-function} After installing the `janitor` package, you want to use the function `get_dupes()` to see if there are any duplicates in your data. @@ -571,7 +568,7 @@ quiz( ) ``` -## Stuck? A Short Guide to Troubleshooting and Getting Help +## Troubleshooting If you've been coding for more than an hour, you've definitely had to troubleshoot your code. However, errors can be cryptic, using a new package can be confounding, and, despite your best efforts, you may still end up needing help from someone else. In this section, you'll find a brief, non-exhaustive guide to troubleshooting. @@ -582,17 +579,7 @@ RStudio enables debugging via: - `traceback()` - Flagging problematic lines of code -After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the `traceback()` function to identify the source of the error. You can run `traceback()` from the console after an error is raised, or you can set it as an error handler, which means it is called automatically. The latter option is demonstrated below. Just a heads up, the output is often quite cryptic so it's up to you to decide if it's helpful. - -```{r traceback-setup} -f <- function(x) x + 1 #a function that adds 1 to the input -g <- function(x) f(x) #a function that calls f on its input -``` - -```{r traceback, exercise = TRUE, exercise.setup=traceback-setup} -options(error = traceback) -g("a") -``` +After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the `traceback()` function to identify the source of the error. You can run `traceback()` from the console after an error is raised. Just a heads up, the output is often quite cryptic so it's up to you to decide if it's helpful. RStudio also flags problematic lines of code. It's a red dot that appears to the left of your code for lines where something isn't "quite right". Hovering over the red dot provides you with some additional information, but it typically appears when you make a syntax error like forgetting a closing bracket. @@ -602,12 +589,21 @@ While `?function_name` is helpful when you know which function you want to use, ### Asking for Help -Before proceeding with this section, make sure you have exhausted all avenues for troubleshooting on your own. Some reliable sources are: +Before proceeding with this section, make sure you have exhausted all avenues for troubleshooting on your own. The best way to learn how to resolve an error is to google it verbatim. Some reliable sources are: - Stack Exchange: A forum of crowdsourced answers to common problems - The Comprehensive R Archive Network (CRAN)/Bioconductor: Repositories for the vast majority of R packages. All vignettes can be found here as well. - RStudio Community: Another forum, but it's specific to R and RStudio. +Additionally, here is a compilation of the common errors we addressed in this tutorial: + +- [Object not found](#object) +- [Invalid 'type' of argument](#invalid-type) +- [Missing quotations and equal signs](#types) +- [Missing dependencies](#dependency) +- [Package not found](#no-package) +- [Function not found](#no-function) + When sending your code to someone else for review, it is important to also include: - Any files you're loading in your script diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index 3dde820..06446b2 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -174,7 +174,7 @@

    A Tour of RStudio

  • Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages.

  • To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane.

    -
    +

    Check Your Understanding

    The command below is used to display the object dog. However, when running it, you get an error.

    @@ -278,7 +278,7 @@

    Defining Variables

    difference <- product - 7
    -
    +

    Check Your Understanding

    Without running the code below, what is the final value of x?

    @@ -300,7 +300,7 @@

    Check Your Understanding

    Functions in R

    -
    +

    Overview

    Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where function() is the name of the function and arguments are the different parameters you can specify (i.e. your input):

    function(argument1 = ..., argument2 = ..., ...)

    @@ -322,7 +322,7 @@

    Overview

    -
    +

    Data Types in R

    You’ve seen that paste() operates on text while sum() does not. In other words, different functions accept different data types. In this section, we’ll cover three basic data types: numeric, character, and logical. The function class() tells you what the variable’s type is.

    Run the code below:

    @@ -348,14 +348,6 @@

    Data Types in R

    a

    The last data type we’ll cover is logical, which takes on the values of TRUE or FALSE. In addition to being function arguments, they are also the outputs of logical statements. Logical statements use logical operators to compare two elements. You’ve likely seen some of the logical operators before, but here is a list of the basic ones:

    -

    [Place image here]

    -Run the code below. Is it what you expected? Based on the table above, what’s missing? -
    -
    5 = 7
    - -
    -

    In R, to test if two elements are equal, you have to use two equal signs. When you use only one, R assumes you’re trying to assign a value to a variable. We can’t assign 7 to 5, so an error gets thrown.

    -Here are some more logical statements in action:
    0 < 1 # smaller than
     0 >= 0 # larger-or-equal to
    @@ -364,6 +356,12 @@ 

    Data Types in R

    5 != pi # not equal to
    +Run the code below. Is it what you expected? Based on the code above, what’s missing? +
    +
    5 = 7
    + +
    +

    In R, to test if two elements are equal, you have to use two equal signs. When you use only one, R assumes you’re trying to assign a value to a variable. We can’t assign 7 to 5, so an error gets thrown.

    Below, write two logical statements using the template, one evaluating to TRUE and the other to FALSE.

    # ... <= ...
    @@ -407,7 +405,7 @@ 

    Getting Help

    The Method section describes the implementation method of the function select()

    The Examples Section has examples of the function that can be directly copied and pasted into your terminal and run.

    -
    +

    Check Your Understanding

    Pull up the help page for the function mean()

    @@ -472,7 +470,7 @@

    Data Frames

    In grades, we have three columns for the three variables we’re interested in: the student’s name, their score on an exam, and whether they passed the exam. Each of the five rows represents a set of data collected from a student. Under each column name, the data type of the column is displayed. The three types here are chr, or character; dbl, a type of numeric data; and lgl, or logical.

    What do you notice about the last row? Joe hasn’t taken the exam yet, so his score, and consequently his passing status, are missing. NA is used to represent missing data in vectors and data frames. It doesn’t have an explicit data type, so it can be used in vectors and columns of any type.

    -
    +

    Check Your Understanding

    Pull up the documentation for mean() again.

    @@ -520,7 +518,7 @@

    Check Your Understanding

    R packages

    The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to “open” the package by loading it.

    -
    +

    Installing Packages

    In this tutorial, we will be using the “tidyverse” package. This package contains a versatile set of functions designed for easy manipulation of data.

    You should have already installed the “tidyverse” package using RStudio’s graphical interface. Packages can also be installed by entering the function install.packages() in the console (to install a different package just replace “tidyverse” with the name of the desired package):

    @@ -531,7 +529,7 @@

    Installing Packages

    This tells you that, for whatever reason, these dependencies were not installed properly and therefore your package either can’t be installed or run. The best way to resolve this issue is to install these dependencies using separate install.packages() commands.

    -
    +

    Loading packages

    After installing a package, and everytime you open a new RStudio session, you need to first load (open) the packages you want to use with the library() function. This tells R to access the package’s functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it.

    Packages can be loaded like this:

    @@ -548,7 +546,7 @@

    Loading packages

    You can then use the function BiocManager::install() to install a Bioconductor package. To install the Annotate package, we would execute the following code.

    BiocManager::install("annotate") Sometimes two packages include functions with the same name. A common example is that a select() function is included both in the dplyr and MASS packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: package::function().

    -
    +

    Check Your Understanding

    After installing the janitor package, you want to use the function get_dupes() to see if there are any duplicates in your data.

    @@ -565,8 +563,8 @@

    Check Your Understanding

    -
    -

    Stuck? A Short Guide to Troubleshooting and Getting Help

    +
    +

    Troubleshooting

    If you’ve been coding for more than an hour, you’ve definitely had to troubleshoot your code. However, errors can be cryptic, using a new package can be confounding, and, despite your best efforts, you may still end up needing help from someone else. In this section, you’ll find a brief, non-exhaustive guide to troubleshooting.

    Tackling Errors

    @@ -575,25 +573,30 @@

    Tackling Errors

  • traceback()
  • Flagging problematic lines of code
  • -

    After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the traceback() function to identify the source of the error.

    +

    After an error is thrown, RStudio will print the error message in the console and provide you with the option of running the traceback() function to identify the source of the error. You can run traceback() from the console after an error is raised. Just a heads up, the output is often quite cryptic so it’s up to you to decide if it’s helpful.

    RStudio also flags problematic lines of code. It’s a red dot that appears to the left of your code for lines where something isn’t “quite right”. Hovering over the red dot provides you with some additional information, but it typically appears when you make a syntax error like forgetting a closing bracket.

    -

    You, of course, can also take steps to troubleshoot. Two best practices are:

    -
      -
    • Printing out intermediates: If you’re running one big function you wrote or stringing together several steps in a row, try running each piece one at a time and printing the output to see where the error is occurring.
    • -
    • Googling the error: Unless you’re doing groundbreaking computer science, someone has encountered your error before. Google the error message verbatim and visit forums like Stack Exchange to get crowdsourced troubleshooting tips.
    • -

    Working with New Packages

    -

    While ?function_name is helpful when you know which function you want to use, vignettes are what you need when you don’t know where to start. Vignettes are detailed summaries of packages. They go over common workflows and functions, and explain the background and theory behind their implementation. You can search for vignettes with browseVignettes("package_name"); an example is provided below:

    -
    -
    browseVignettes("tidyverse")
    - -
    -

    Running this code will take you to a page listing all of the vignettes available for that package.

    +

    While ?function_name is helpful when you know which function you want to use, vignettes are what you need when you don’t know where to start. Vignettes are detailed summaries of packages. They go over common workflows and functions, and explain the background and theory behind their implementation. You can search for vignettes with browseVignettes("package_name"). For example, running browseVignettes("tidyverse") will open a browser page listing all of the vignettes available for the tidyverse package.

    Asking for Help

    +

    Before proceeding with this section, make sure you have exhausted all avenues for troubleshooting on your own. The best way to learn how to resolve an error is to google it verbatim. Some reliable sources are:

    +
      +
    • Stack Exchange: A forum of crowdsourced answers to common problems
    • +
    • The Comprehensive R Archive Network (CRAN)/Bioconductor: Repositories for the vast majority of R packages. All vignettes can be found here as well.
    • +
    • RStudio Community: Another forum, but it’s specific to R and RStudio.
    • +
    +

    Additionally, here is a compilation of the common errors we addressed in this tutorial:

    +

    When sending your code to someone else for review, it is important to also include:

    • Any files you’re loading in your script
    • @@ -644,11 +647,11 @@

      Asking for Help

      @@ -775,7 +778,7 @@

      Asking for Help

      - - @@ -893,7 +889,7 @@

      Asking for Help

      Michelle Kang (adapted from Dr. Kim Dill-McFarland)

      -

      version December 01, 2020

      +

      version December 12, 2020

      From a9ca88792c5d075408d56db6d75f88c981cc34f2 Mon Sep 17 00:00:00 2001 From: cathy-y Date: Sat, 12 Dec 2020 13:21:30 -0800 Subject: [PATCH 20/20] Updated internal links Can only link to sections, not subsections --- .../r_and_rstudio_basic.Rmd | 28 +++++++++---------- .../r_and_rstudio_basic.html | 24 ++++++++-------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd index 5519711..b33aa08 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.Rmd @@ -71,7 +71,7 @@ R Packages: - Understand what R packages are and how they are used - Install and load packages -## A Tour of RStudio +## A Tour of RStudio {#object} When you start RStudio, you will see something like the following window appear: @@ -88,7 +88,7 @@ Notice that the window has three "panes": To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane. -### Check Your Understanding {#object} +### Check Your Understanding The command below is used to display the object `dog`. However, when running it, you get an error. @@ -231,9 +231,9 @@ quiz( ) ``` -## Functions in R +## Functions in R {#functions} -### Overview {#invalid-type} +### Overview Functions are one of the basic units in programming. Generally speaking, a function takes some input and generates some output, in a reproducible way. Every R function follows the same basic syntax, where `function()` is the name of the function and `arguments` are the different parameters you can specify (i.e. your input): @@ -261,7 +261,7 @@ On the other hand, the function `paste()`, which links together words, does acce paste("Hello", "world", sep = " ") ``` -### Data Types in R {#types} +### Data Types in R You've seen that `paste()` operates on text while `sum()` does not. In other words, different functions accept different data types. In this section, we'll cover three basic data types: numeric, character, and logical. The function `class()` tells you what the variable's type is. @@ -497,11 +497,11 @@ y <- c(5, 12, 64, 1, NA) mean(y, na.rm=TRUE) ``` -## R packages +## R packages {#package} The first functions we will look at are used to install and load R packages. R packages are units of shareable code, containing functions that facilitate and enhance analyses. In simpler terms, think of R packages as iPhone Applications. Each App has specific capabilities that can be accessed when we install and then open the application. The same holds true for R packages. To use the functions contained in a specific R package, we first need to install the package, then each time we want to use the package we need to "open" the package by loading it. -### Installing Packages {#dependency} +### Installing Packages In this tutorial, we will be using the "tidyverse" package. This package contains a versatile set of functions designed for easy manipulation of data. @@ -521,7 +521,7 @@ The key part to focus on here is the line, "also installing the dependencies.... This tells you that, for whatever reason, these dependencies were not installed properly and therefore your package either can't be installed or run. The best way to resolve this issue is to install these dependencies using separate `install.packages()` commands. -### Loading packages {#no-package} +### Loading packages After installing a package, and *everytime* you open a new RStudio session, you need to first load (open) the packages you want to use with the `library()` function. This tells R to access the package's functions and prevents RStudio from lags that would occur if it automatically loaded every downloaded package every time you opened it. @@ -551,7 +551,7 @@ You can then use the function `BiocManager::install()` to install a Bioconductor `BiocManager::install("annotate")` Sometimes two packages include functions with the same name. A common example is that a `select()` function is included both in the `dplyr` and `MASS` packages. Therefore, to specify the use of a function from a particular package, you can precede the function with a the following notation: `package::function()`. -### Check Your Understanding {#no-function} +### Check Your Understanding After installing the `janitor` package, you want to use the function `get_dupes()` to see if there are any duplicates in your data. @@ -598,11 +598,11 @@ Before proceeding with this section, make sure you have exhausted all avenues fo Additionally, here is a compilation of the common errors we addressed in this tutorial: - [Object not found](#object) -- [Invalid 'type' of argument](#invalid-type) -- [Missing quotations and equal signs](#types) -- [Missing dependencies](#dependency) -- [Package not found](#no-package) -- [Function not found](#no-function) +- [Invalid 'type' of argument](#functions) +- [Missing quotations and equal signs](#functions) +- [Missing dependencies](#package) +- [Package not found](#package) +- [Function not found](#package) When sending your code to someone else for review, it is important to also include: diff --git a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html index 06446b2..9a1b5d7 100644 --- a/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html +++ b/inst/tutorials/r_and_rstudio_basic/r_and_rstudio_basic.html @@ -163,7 +163,7 @@

      Learning objectives

    • Install and load packages
    -
    +

    A Tour of RStudio

    When you start RStudio, you will see something like the following window appear:

    @@ -174,7 +174,7 @@

    A Tour of RStudio

  • Files/Help/Plots/Packages (tabbed in the lower right): as their names suggest, you can view the contents of the current directory, the built-in help pages, and the graphics you created, as well as manage R packages.

  • To change the look of RStudio, you can go to Tools → Global Options → Appearance and select colours, font size, etc. If you plan on working for longer periods of time, we suggest choosing a dark background colour which is less hard on your computer battery and your eyes. You can also change the sizes of the panes by dragging the dividers or clicking on the expand and compress icons at the top right corner of each pane.

    -
    +

    Check Your Understanding

    The command below is used to display the object dog. However, when running it, you get an error.

    @@ -278,7 +278,7 @@

    Defining Variables

    difference <- product - 7
    -
    +

    Check Your Understanding

    Without running the code below, what is the final value of x?

    @@ -405,7 +405,7 @@

    Getting Help

    The Method section describes the implementation method of the function select()

    The Examples Section has examples of the function that can be directly copied and pasted into your terminal and run.

    -
    +

    Check Your Understanding

    Pull up the help page for the function mean()

    @@ -470,7 +470,7 @@

    Data Frames

    In grades, we have three columns for the three variables we’re interested in: the student’s name, their score on an exam, and whether they passed the exam. Each of the five rows represents a set of data collected from a student. Under each column name, the data type of the column is displayed. The three types here are chr, or character; dbl, a type of numeric data; and lgl, or logical.

    What do you notice about the last row? Joe hasn’t taken the exam yet, so his score, and consequently his passing status, are missing. NA is used to represent missing data in vectors and data frames. It doesn’t have an explicit data type, so it can be used in vectors and columns of any type.

    -
    +

    Check Your Understanding

    Pull up the documentation for mean() again.

    @@ -647,11 +647,11 @@

    Asking for Help