├── .gitignore
├── 00-before-we-start.Rmd
├── 00-before-we-start.html
├── 01-intro-to-R.Rmd
├── 01-intro-to-R.html
├── 02-starting-with-data.Rmd
├── 02-starting-with-data.html
├── 03-data-frames.Rmd
├── 03-data-frames.html
├── 04-dplyr.Rmd
├── 04-dplyr.html
├── 05-data-visualization.Rmd
├── 05-data-visualization.html
├── 05-r-and-sql.Rmd
├── 05-visualisation-ggplot2.Rmd
├── CONDUCT.Rmd
├── CONDUCT.html
├── CONTRIBUTING.Rmd
├── CONTRIBUTING.html
├── Ecoli_genomes_with_SNPs_per_locus_tag.txt
├── Ecoli_metadata.csv
├── Ecoli_metadata.txt
├── LICENSE.Rmd
├── LICENSE.html
├── Makefile
├── README.md
├── R_visualization.md
├── _config.yml
├── _includes
├── anySetup.html
├── banner.html
├── footer.html
├── header.html
├── javascript.html
├── lesson-index.html
├── pythonSetup.html
├── rSetup.html
├── setup.html
└── spreadsheetSetup.html
├── _layouts
├── lesson.html
├── slides.html
└── workshop.html
├── _site.yml
├── css
├── bootstrap
│ ├── bootstrap-responsive.css
│ ├── bootstrap.css
│ └── img
│ │ ├── glyphicons-halflings-white.png
│ │ └── glyphicons-halflings.png
├── lesson.css
├── pygments
│ └── friendly.css
├── swc-bootstrap.css
└── swc.css
├── data
├── Ecoli_genomes_with_SNPs_per_locus_tag.txt
├── Ecoli_metadata.csv
└── Ecoli_metadata.txt
├── footer.html
├── img
├── DC-logo-vision.png
├── DC1_logo_small.png
├── DataONE_LOGO.jpg
├── R-ecology-correct-order-1.png
├── R-ecology-wrong-order-1.png
├── creative-commons-attribution-license.png
├── r-lesson-boxplot-1.png
├── r-lesson-correct-order-1.png
├── r-lesson-scatter-plot1-1.png
├── r-lesson-unnamed-chunk-10-1.png
├── r-lesson-unnamed-chunk-11-1.png
├── r-lesson-unnamed-chunk-13-1.png
├── r-lesson-unnamed-chunk-14-1.png
├── r-lesson-unnamed-chunk-3-1.png
├── r-lesson-unnamed-chunk-4-1.png
├── r-lesson-unnamed-chunk-5-1.png
├── r-lesson-unnamed-chunk-6-1.png
├── r-lesson-wrong-order-1.png
├── r_starting_example_script.png
└── r_starting_how_it_should_like.png
├── index.Rmd
├── index.html
├── journal.pone.0081760.s004.csv
├── site_libs
├── bootstrap-3.3.5
│ ├── css
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ ├── cerulean.min.css
│ │ ├── cosmo.min.css
│ │ ├── flatly.min.css
│ │ ├── fonts
│ │ │ ├── Lato.ttf
│ │ │ ├── LatoBold.ttf
│ │ │ ├── LatoItalic.ttf
│ │ │ ├── NewsCycle.ttf
│ │ │ ├── NewsCycleBold.ttf
│ │ │ ├── OpenSans.ttf
│ │ │ ├── OpenSansBold.ttf
│ │ │ ├── OpenSansBoldItalic.ttf
│ │ │ ├── OpenSansItalic.ttf
│ │ │ ├── OpenSansLight.ttf
│ │ │ ├── OpenSansLightItalic.ttf
│ │ │ ├── Raleway.ttf
│ │ │ ├── RalewayBold.ttf
│ │ │ ├── Roboto.ttf
│ │ │ ├── RobotoBold.ttf
│ │ │ ├── RobotoLight.ttf
│ │ │ ├── RobotoMedium.ttf
│ │ │ ├── SourceSansPro.ttf
│ │ │ ├── SourceSansProBold.ttf
│ │ │ ├── SourceSansProItalic.ttf
│ │ │ ├── SourceSansProLight.ttf
│ │ │ └── Ubuntu.ttf
│ │ ├── journal.min.css
│ │ ├── lumen.min.css
│ │ ├── paper.min.css
│ │ ├── readable.min.css
│ │ ├── sandstone.min.css
│ │ ├── simplex.min.css
│ │ ├── spacelab.min.css
│ │ ├── united.min.css
│ │ └── yeti.min.css
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ ├── js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ └── npm.js
│ └── shim
│ │ ├── html5shiv.min.js
│ │ └── respond.min.js
├── font-awesome-5.0.13
│ ├── css
│ │ └── fa-svg-with-js.css
│ ├── fonts
│ │ ├── fa-brands-400.ttf
│ │ ├── fa-regular-400.ttf
│ │ └── fa-solid-900.ttf
│ └── js
│ │ ├── fa-v4-shims.min.js
│ │ └── fontawesome-all.min.js
├── jquery-1.11.3
│ └── jquery.min.js
├── jqueryui-1.11.4
│ ├── README
│ ├── images
│ │ ├── ui-icons_444444_256x240.png
│ │ ├── ui-icons_555555_256x240.png
│ │ ├── ui-icons_777620_256x240.png
│ │ ├── ui-icons_777777_256x240.png
│ │ ├── ui-icons_cc0000_256x240.png
│ │ └── ui-icons_ffffff_256x240.png
│ ├── index.html
│ ├── jquery-ui.css
│ ├── jquery-ui.js
│ ├── jquery-ui.min.css
│ ├── jquery-ui.min.js
│ ├── jquery-ui.structure.css
│ ├── jquery-ui.structure.min.css
│ ├── jquery-ui.theme.css
│ └── jquery-ui.theme.min.css
├── navigation-1.1
│ ├── codefolding.js
│ ├── sourceembed.js
│ └── tabsets.js
└── tocify-1.9.1
│ ├── jquery.tocify.css
│ └── jquery.tocify.js
└── style.css
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 |
3 | # History files
4 | .Rhistory
5 |
6 | # Example code in package build process
7 | *-Ex.R
8 |
9 | # R data files from past sessions
10 | .Rdata
11 |
12 | # RStudio files
13 | .Rproj.user/
14 | .Rproj.user
15 | *.Rproj
16 |
17 | # vim backup files
18 | *.swp
19 | /data/
20 | /portalR.db
21 | data_output/
22 |
--------------------------------------------------------------------------------
/00-before-we-start.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | layout: topic
3 | title: Before we start
4 | author: Data Carpentry contributors
5 | minutes: 15
6 | ---
7 |
8 | ```{r, echo=FALSE, purl=FALSE}
9 | knitr::opts_chunk$set(results='hide', fig.path='img/r-lesson-')
10 | ```
11 | ------------
12 |
13 | > ## Learning Objectives
14 | >
15 | > * Describe the purpose of RStudio’s script, console, environment, and file/plot/help windows.
16 | > * Create an R project.
17 | > * Organize files and directories for a set of analyses as an R Project.
18 | > * Use the built-in RStudio help interface to search for more information on R functions.
19 |
20 |
21 | ------------
22 |
23 | # Presentation of RStudio
24 |
25 | Start RStudio -- Let's start by learning about our tool.
26 |
27 | * Console, Scripts, Environments, Plots
28 | * Code and workflow are more reproducible if we can document everything that we
29 | do.
30 | * Our end goal is not just to "do stuff" but to do it in a way that anyone can
31 | easily and exactly replicate our workflow and results.
32 |
33 | # Before we get started
34 |
35 | * Under the `File` menu, click on `New project`, choose `New directory`, then
36 | `Empty project`
37 | * Enter a name for this new folder, and choose a convenient location for
38 | it. This will be your **working directory** for the rest of the day
39 | (e.g., `~/data-carpentry`)
40 | * Confirm that the folder named in the `Create project as a sub-directory of` box is where you want the working directory created. Use the `Browse` button to navigate folders if changes are needed.
41 | * Click on "Create project"
42 | * Under the `Files` tab on the right of the screen, click on `New Folder` and
43 | create a folder named `data` within your newly created working directory.
44 | (e.g., `~/data-carpentry/data`)
45 | * Create a new R script (File > New File > R script) and save it in your working
46 | directory (e.g. `data-carpentry-script.R`)
47 |
48 | Your working directory should now look like this:
49 |
50 | 
51 |
52 |
53 | # Interacting with R
54 |
55 | There are two main ways of interacting with R: using the console or by using
56 | script files (plain text files that contain your code).
57 |
58 | The console window (in RStudio, the bottom left panel) is the place where R is
59 | waiting for you to tell it what to do, and where it will show the results of a
60 | command. You can type commands directly into the console, but they will be
61 | forgotten when you close the session. It is better to enter the commands in the
62 | script editor, and save the script. This way, you have a complete record of what
63 | you did, you can easily show others how you did it and you can do it again later
64 | on if needed. You can copy-paste into the R console, but the Rstudio script
65 | editor allows you to 'send' the current line or the currently selected text to
66 | the R console using the `Ctrl-Enter` shortcut.
67 |
68 | If R is ready to accept commands, the R console shows a `>` prompt. If it
69 | receives a command (by typing, copy-pasting or sent from the script editor using
70 | Ctrl-Enter), R will try to execute it, and when ready, show the results and
71 | come back with a new `>` prompt to wait for new commands.
72 |
73 | If R is still waiting for you to enter more data because it isn't complete yet,
74 | the console will show a `+` prompt. It means that you haven't finished entering
75 | a complete command. This is because you have not 'closed' a parenthesis or
76 | quotation. If you're in Rstudio and this happens, click inside the console
77 | window and press Esc; this should help you out of trouble.
78 |
79 | # Basics of R
80 |
81 | R is a versatile, open source programming/scripting language that's useful both
82 | for statistics but also data science. Inspired by the programming language S.
83 |
84 | * Open source software under GPL.
85 | * Superior (if not just comparable) to commercial alternatives. R has over 7,000
86 | user contributed packages at this time. It's widely used both in academia and
87 | industry.
88 | * Available on all platforms.
89 | * Not just for statistics, but also general purpose programming.
90 | * For people who have experience in programmming: R is both an object-oriented
91 | and a so-called [functional language](http://adv-r.had.co.nz/Functional-programming.html)
92 | * Large and growing community of peers.
93 |
94 |
95 | ## Organizing your working directory
96 |
97 | You should separate the original data (raw data) from intermediate datasets that
98 | you may create for the need of a particular analysis. For instance, you may want
99 | to create a `data/` directory within your working directory that stores the raw
100 | data, and have a `data_output/` directory for intermediate datasets and a
101 | `figure_output/` directory for the plots you will generate.
102 |
--------------------------------------------------------------------------------
/02-starting-with-data.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | layout: topic
3 | title: Starting with data
4 | author: Data Carpentry contributors
5 | minutes: 25
6 | ---
7 |
8 | ```{r, echo=FALSE, purl=FALSE}
9 | knitr::opts_chunk$set(results='hide', fig.path='img/r-lesson-')
10 | ```
11 |
12 | ------------
13 |
14 | > ## Learning Objectives
15 | >
16 | > * Load external tabular data from a .csv file into R.
17 | > * Describe what an R data frame is.
18 | > * Summarize the contents of a data frame in R.
19 | > * Manipulate categorical data in R using factors.
20 |
21 |
22 | ------------
23 |
24 | # Looking at Metadata
25 |
26 | ```{r, echo=FALSE, purl=TRUE}
27 | # Looking at metadata
28 | ```
29 |
30 | We are studying a population of Escherichia coli (designated Ara-3), which were propagated for more than 40,000 generations in a glucose-limited minimal medium. This medium was supplemented with citrate which E. coli cannot metabolize in the aerobic conditions of the experiment. Sequencing of the populations at regular time points reveals that spontaneous citrate-using mutants (Cit+) appeared at around 31,000 generations. This metadata describes information on the Ara-3 clones and the columns represent:
31 |
32 | | Column | Description |
33 | |------------------|--------------------------------------------|
34 | | sample | clone name |
35 | | generation | generation when sample frozen |
36 | | clade | based on parsimony-based tree |
37 | | strain | ancestral strain |
38 | | cit | citrate-using mutant status |
39 | | run | Sequence read archive sample ID |
40 | | genome_size | size in Mbp (made up data for this lesson) |
41 |
42 |
43 |
44 |
45 |
46 | The metadata file required for this lesson can be [downloaded directly here](https://raw.githubusercontent.com/datacarpentry/R-genomics/gh-pages/data/Ecoli_metadata.csv) or [viewed in Github](./data/Ecoli_metadata.csv).
47 |
48 | > Tip:
49 | > If you can't find the Ecoli_metadata.csv file, or have lost track of it,
50 | > download the file directly using the R `download.file() function`
51 |
52 | ```{r, eval=TRUE, purl=FALSE}
53 | download.file("https://raw.githubusercontent.com/datacarpentry/R-genomics/gh-pages/data/Ecoli_metadata.csv", "data/Ecoli_metadata.csv")
54 | ```
55 |
56 | You are now ready to load the data. We are going to use the R function `read.csv()` to load the data file into memory (as a `data.frame`):
57 |
58 | ```{r, eval=TRUE, purl=FALSE}
59 | metadata <- read.csv('data/Ecoli_metadata.csv')
60 | ```
61 |
62 | This statement doesn't produce any output because assignment doesn't display
63 | anything. If we want to check that our data has been loaded, we can print the
64 | variable's value: `metadata`
65 |
66 | Alternatively, wrapping an assignment in parentheses will perform the assignment
67 | and display it at the same time.
68 |
69 | ```{r, eval = TRUE, purl = FALSE}
70 | (metadata <- read.csv('data/Ecoli_metadata.csv'))
71 | ```
72 |
73 | Wow... that was a lot of output. At least it means the data loaded properly. Let's check the top (the first 6 lines) of this `data.frame` using the function `head()`:
74 |
75 | ```{r, results='show', purl=FALSE}
76 | head(metadata)
77 | ```
78 |
79 | We've just done two very useful things.
80 | 1. We've read our data in to R, so now we can work with it in R
81 | 2. We've created a data frame (with the read.csv command) the
82 | standard way R works with data.
83 |
84 | # What are data frames?
85 |
86 | `data.frame` is the _de facto_ data structure for most tabular data and what we
87 | use for statistics and plotting.
88 |
89 | A `data.frame` is a collection of vectors of identical lengths. Each vector
90 | represents a column, and each vector can be of a different data type (e.g.,
91 | characters, integers, factors). The `str()` function is useful to inspect the
92 | data types of the columns.
93 |
94 | A `data.frame` can be created by the functions `read.csv()` or `read.table()`, in
95 | other words, when importing spreadsheets from your hard drive (or the web).
96 |
97 | By default, `data.frame` converts (= coerces) columns that contain characters
98 | (i.e., text) into the `factor` data type. Depending on what you want to do with
99 | the data, you may want to keep these columns as `character`. To do so,
100 | `read.csv()` and `read.table()` have an argument called `stringsAsFactors` which
101 | can be set to `FALSE`:
102 |
103 | Let's now check the __str__ucture of this `data.frame` in more details with the
104 | function `str()`:
105 |
106 | ```{r, purl=FALSE}
107 | str(metadata)
108 | ```
109 |
110 | # Inspecting `data.frame` objects
111 |
112 | We already saw how the functions `head()` and `str()` can be useful to check the
113 | content and the structure of a `data.frame`. Here is a non-exhaustive list of
114 | functions to get a sense of the content/structure of the data.
115 |
116 | * Size:
117 | + `dim()` - returns a vector with the number of rows in the first element, and
118 | the number of columns as the second element (the __dim__ensions of the object)
119 | + `nrow()` - returns the number of rows
120 | + `ncol()` - returns the number of columns
121 | * Content:
122 | + `head()` - shows the first 6 rows
123 | + `tail()` - shows the last 6 rows
124 | * Names:
125 | + `names()` - returns the column names (synonym of `colnames()` for `data.frame`
126 | objects)
127 | + `rownames()` - returns the row names
128 | * Summary:
129 | + `str()` - structure of the object and information about the class, length and
130 | content of each column
131 | + `summary()` - summary statistics for each column
132 |
133 | Note: most of these functions are "generic", they can be used on other types of
134 | objects besides `data.frame`.
135 |
136 |
137 | ### Challenge
138 |
139 | Based on the given table of functions to asses data structure, can you answer the following questions?
140 |
141 | * What is the class of the object `metadata`?
142 | * How many rows and how many columns are in this object?
143 | * How many citrate+ mutants have been recorded in this population?
144 |
145 |
146 | As you can see, many of the columns in our data frame are of a special class called
147 | `factor`. Before we learn more about the `data.frame` class, we are going to
148 | talk about factors. They are very useful but not necessarily intuitive, and
149 | therefore require some attention.
150 |
151 |
152 | ## Factors
153 |
154 | ```{r, echo=FALSE, purl=TRUE}
155 | ### Factors
156 | ```
157 |
158 | Factors are used to represent categorical data. Factors can be ordered or
159 | unordered and are an important class for statistical analysis and for plotting.
160 |
161 | Factors are stored as integers, and have labels associated with these unique
162 | integers. While factors look (and often behave) like character vectors, they are
163 | actually integers under the hood, and you need to be careful when treating them
164 | like strings.
165 |
166 | In the data frame we just imported, let's do
167 | ```{r, purl=TRUE}
168 | str(metadata)
169 | ```
170 |
171 | We can see the names of the multiple columns. And, we see that
172 | some say things like `Factor w/ 30 levels`
173 |
174 | When we read in a file, any column that contains text is automatically
175 | assumed to be a factor. Once created, factors can only contain a pre-defined set values, known as
176 | *levels*. By default, R always sorts *levels* in alphabetical order.
177 |
178 | For instance, we see that `cit` is a Factor w/ 3 levels, `minus`, `plus` and `unknown`.
179 |
180 |
248 |
--------------------------------------------------------------------------------
/03-data-frames.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | layout: topic
3 | title: Using data in data frames
4 | author: Data Carpentry contributors
5 | minutes: 30
6 | ---
7 |
8 | ```{r, echo=FALSE, purl=TRUE}
9 | ## The data.frame class
10 | ```
11 |
12 | ------------
13 |
14 | > ## Learning Objectives
15 | >
16 | > * Extract values from vectors and data frames.
17 | > * Perform operations on columns in a data frame.
18 | > * Append columns to a data frame.
19 | > * Create subsets of a data frame.
20 |
21 |
22 | ------------
23 |
24 | In this lesson you will learn how to extract and manipulate data stored in data frames in R. We will work with the *E. coli* metadata file that we used previously. Be sure to read this file into a dataframe named `metadata`, if you haven't already done so.
25 |
26 | ```{r, eval=TRUE, purl=FALSE}
27 | metadata <- read.csv('data/Ecoli_metadata.csv')
28 | ```
29 |
30 | Because the columns of a data frame are vectors, we will first learn how to extract elements from vectors and then learn how to apply this concept to select rows and columns from a data frame.
31 |
32 | # Extracting values with indexing and sequences
33 |
34 | ```{r, echo=FALSE, purl=TRUE}
35 | ## Indexing and sequences
36 | ```
37 |
38 | ## Vectors
39 |
40 | Let's create a vector containing the first ten letters of the alphabet.
41 |
42 | ```{r, purl=FALSE, eval=FALSE}
43 | ten_letters <- c('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')
44 | ```
45 |
46 | In order to extract one or several values from a vector, we must provide one or several indices in square brackets, just as we do in math. R indexes start at 1. Programming languages like Fortran, MATLAB, and R start counting at 1, because that's what human beings typically do. Languages in the C family (including C++, Java, Perl, and Python) count from 0 because that's simpler for computers to do.
47 |
48 | So, to extract the 2nd element of `ten_letters` we type:
49 |
50 | ```{r, purl=FALSE, eval=FALSE}
51 | ten_letters[2]
52 | ```
53 |
54 | We can extract multiple elements at a time by specifying mulitple indices inside the square brackets as a vector. Notice how you can use `:` to make a vector of all integers two numbers.
55 |
56 | ```{r, purl=FALSE, eval=FALSE}
57 | ten_letters[c(1,7)]
58 |
59 | ten_letters[3:6]
60 |
61 | ten_letters[10:1]
62 |
63 | ten_letters[c(2, 8:10)]
64 |
65 | ```
66 |
67 | Quick exercise / formative assessment: Select every other element in `ten_letters`.
68 |
69 | What if we were dealing with a much longer vector? We can use the `seq()` function to quickly create sequences of numbers.
70 |
71 | ```{r, purl=FALSE, eval=FALSE}
72 | seq(1, 10, by = 2)
73 | seq(20, 4, by = -3)
74 | ```
75 |
76 |
84 |
85 | > ## Exercise
86 | >
87 | > Fill in the blank to select the even elements of ten_letters using the seq() function.
88 | >
89 | > ten_letters[____________]
90 | >
91 | > > ## Solution
92 | > > ten_letters[seq(2, 10, by = 2)]
93 | > {: .solution}
94 | {: .challenge}
95 |
96 |
97 | ## Data frames
98 |
99 | The metadata data frame has rows and columns (it has 2 dimensions), if we want to
100 | extract some specific data from it, we need to specify the "coordinates" we want
101 | from it. Row numbers come first, followed by column numbers (i.e. [row, column]).
102 |
103 | ```{r, purl=FALSE, eval=FALSE}
104 | metadata[1, 2] # 1st element in the 2nd column
105 | metadata[1, 6] # 1st element in the 6th column
106 | metadata[1:3, 7] # First three elements in the 7th column
107 | metadata[3, ] # 3rd element for all columns
108 | metadata[, 7] # Entire 7th column
109 | ```
110 |
111 |
112 | > ## Challenge
113 | >
114 | > The function `nrow()` on a `data.frame` returns the number of rows. For example, try typing nrow(metadata)`.
115 | > Use `nrow()` and `seq()` to create a new data frame called `meta_by_2` that includes all even numbered rows of `metadata`.
116 | >
117 | > ## Solution
118 | > > meta_data[seq(2, nrow(metadata), by = 2, ]
119 | > >
120 | > >
121 | > {: .solution}
122 | {: .challenge}
123 |
124 | For larger datasets, it can be tricky to remember the column number that corresponds to a particular variable. Sometimes the column number for a particular variable can change if your analysis adds or removes columns. The best practice when working with columns in a data frame is to refer to them by name. This also makes your code easier to read and your intentions clearer.
125 |
126 | There are two ways to select a column by name from a data frame:
127 |
128 | * Using `dataframe[ , "column_name"]`
129 | * Using `dataframe$column_name`
130 |
131 | You can do operations on a particular column, by selecting it using the `$`
132 | sign. In this case, the entire column is a vector. You can use
133 | `names(metadata)` or `colnames(metadata)` to remind yourself of the column names.
134 | For instance, to extract all the strain information from our datasets:
135 |
136 | ```{r, eval=FALSE}
137 | # Select the strain column from metadata
138 | metadata[ , "strain"]
139 |
140 | # Alternatively...
141 | metadata$strain
142 | ```
143 |
144 | The first method allows you to select multiple columns at once. Suppose we wanted strain and clade information:
145 |
146 | ```{r, eval=FALSE}
147 | metadata[, c("strain", "clade")]
148 | ```
149 |
150 | You can even access columns by column name _and_ select specific rows of interest. For example, if we wanted the strain and clade of just rows 4 through 7, we could do:
151 |
152 | ```{r, eval=FALSE}
153 | metadata[4:7, c("strain", "clade")]
154 | ```
155 |
156 |
157 |
13 | ²
14 | ```{r, echo=FALSE, purl=FALSE}²
15 | knitr::opts_chunk$set(results='hide', fig.path='img/r-lesson-', fig.keep='last')
16 | ```
17 |
18 | ```{r setup, echo=FALSE, purl=FALSE}
19 | source("setup.R")
20 | ```
21 |
22 | Authors: **Mateusz Kuzak**, **Diana Marek**, **Hedi Peterson**
23 |
24 |
25 |
26 | #### Disclaimer
27 |
28 | We will here using functions of ggplot2 package. There are basic ploting
29 | capabilities in basic R, but ggplot2 adds more powerful plotting capabilities.
30 |
31 | > ### Learning Objectives
32 | >
33 | > - Visualise some of the
34 | >[mammals data](http://figshare.com/articles/Portal_Project_Teaching_Database/1314459)
35 | >from Figshare [surveys.csv](http://files.figshare.com/1919744/surveys.csv)
36 | > - Understand how to plot these data using R ggplot2 package. For more details
37 | >on using ggplot2 see
38 | >[official documentation](http://docs.ggplot2.org/current/).
39 | > - Building step by step complex plots with ggplot2 package
40 |
41 | Load required packages
42 |
43 | ```{r}
44 | # plotting package
45 | library(ggplot2)
46 | # piping / chaining
47 | library(magrittr)
48 | # modern dataframe manipulations
49 | library(dplyr)
50 | ```
51 |
52 | Load data directly from figshare.
53 |
54 | ```{r}
55 | surveys_raw <- read.csv("http://files.figshare.com/1919744/surveys.csv")
56 | ```
57 |
58 | `surveys.csv` data contains some measurements of the animals caught in plots.
59 |
60 | ## Data cleaning and preparing for plotting
61 |
62 | Let's look at the summary
63 |
64 | ```{r}
65 | summary(surveys_raw)
66 | ```
67 |
68 | There are few things we need to clean in the dataset.
69 |
70 | There is missing species_id in some records. Let's remove those.
71 |
72 | ```{r}
73 | surveys <- surveys_raw %>%
74 | filter(species_id != "")
75 | ```
76 |
77 | There are a lot of species with low counts, let's remove the ones below 10 counts
78 |
79 | ```{r}
80 | # count records per species
81 | species_counts <- surveys %>%
82 | group_by(species_id) %>%
83 | summarise(n=n())
84 |
85 | # get names of those frequent species
86 | frequent_species <- species_counts %>%
87 | filter(n >= 10) %>%
88 | select(species_id)
89 |
90 | surveys <- surveys %>%
91 | filter(species_id %in% frequent_species$species_id)
92 | ```
93 |
94 | We saw in summary, there were NA's in weight and hindfoot_length. Let's remove
95 | rows with missing weights.
96 |
97 | ```{r}
98 | surveys_weight_present <- surveys %>%
99 | filter(!is.na(weight))
100 | ```
101 |
102 | > ### Challenge
103 | >
104 | > - Do the same to remove rows without `hindfoot_length`. Save results in the new dataframe.
105 |
106 |
107 | ```{r}
108 | surveys_length_present <- surveys %>%
109 | filter(!is.na(hindfoot_length))
110 | ```
111 |
112 | - How would you get the dataframe without missing values?
113 |
114 | ```{r}
115 | surveys_complete <- surveys_weight_present %>%
116 | filter(!is.na(hindfoot_length))
117 | ```
118 |
119 | > We can chain filtering together using pipe operator (`%>%`) introduced earlier.
120 |
121 | ```{r}
122 | surveys_complete <- surveys %>%
123 | filter(!is.na(weight)) %>%
124 | filter(!is.na(hindfoot_length))
125 | ```
126 |
127 | > Make simple scatter plot of `hindfoot_length` (in millimeters) as a function of
128 | > `weight` (in grams), using basic R plotting capabilities.
129 |
130 | ```{r}
131 | plot(x=surveys_complete$weight, y=surveys_complete$hindfoot_length)
132 | ```
133 |
134 | ## Plotting with ggplot2
135 |
136 | We will make the same plot using `ggplot2` package.
137 |
138 | `ggplot2` is a plotting package that makes it sipmple to create complex plots
139 | from data in a dataframe. It uses default settings, which help creating
140 | publication quality plotts with minimal amount of settings and tweaking.
141 |
142 | With ggplot graphics are build step by step by adding new elements.
143 |
144 | To build a ggplot we need to:
145 |
146 | - bind plot to a specific data frame
147 |
148 | ```{r, eval=FALSE}
149 | ggplot(surveys_complete)
150 | ```
151 |
152 | - define aestetics (`aes`), that maps variables in the data to axes on the plot
153 | or to plotting size, shape color, etc.,
154 |
155 | ```{r}
156 | ggplot(surveys_complete, aes(x = weight, y = hindfoot_length))
157 | ```
158 |
159 | - add `geoms` -- graphical representation of the data in the plot (points,
160 | lines, bars). To add a geom to the plot use `+` operator:
161 |
162 | ```{r}
163 | ggplot(surveys_complete, aes(x = weight, y = hindfoot_length)) +
164 | geom_point()
165 | ```
166 |
167 | ## Modifying plots
168 |
169 | - adding transparency (alpha)
170 |
171 | ```{r}
172 | ggplot(surveys_complete, aes(x = weight, y = hindfoot_length)) +
173 | geom_point(alpha=0.1)
174 | ```
175 |
176 | - adding colors
177 |
178 | ```{r}
179 | ggplot(surveys_complete, aes(x = weight, y = hindfoot_length)) +
180 | geom_point(alpha=0.1, color="blue")
181 | ```
182 |
183 | Example of complex visualisation in which plot area is divided into hexagonal
184 | sections and points are counted wihin hexagons. The number of points per hexagon
185 | is encoded by color.
186 |
187 | ```{r}
188 | ggplot(surveys_complete, aes(x = weight, y = hindfoot_length)) + stat_binhex(bins=50) +
189 | scale_fill_gradientn(trans="log10", colours = heat.colors(10, alpha=0.5))
190 | ```
191 |
192 | ## Boxplot
193 |
194 | Visualising the distribution of weight within each species.
195 |
196 | ```{r}
197 | ggplot(surveys_weight_present, aes(factor(species_id), weight)) +
198 | geom_boxplot()
199 | ```
200 |
201 | By adding points to boxplot, we can see particular measurements and the
202 | abundance of measurements.
203 |
204 | ```{r}
205 | ggplot(surveys_weight_present, aes(factor(species_id), weight)) +
206 | geom_jitter(alpha=0.3, color="tomato") +
207 | geom_boxplot(alpha=0)
208 | ```
209 |
210 | > ### Challenge
211 | >
212 | > Create boxplot for `hindfoot_length`.
213 |
214 | ## Plotting time series data
215 |
216 | Let's calculate number of counts per year for each species. To do that we need
217 | to group data first and count records within each group.
218 |
219 | ```{r}
220 | yearly_counts <- surveys %>%
221 | group_by(year, species_id) %>%
222 | summarise(count=n())
223 | ```
224 |
225 | Timelapse data can be visualised as a line plot with years on x axis and counts
226 | on y axis.
227 |
228 | ```{r}
229 | ggplot(yearly_counts, aes(x=year, y=count)) +
230 | geom_line()
231 | ```
232 |
233 | Unfortunately this does not work, because we plot data for all the species
234 | together. We need to tell ggplot to split graphed data by `species_id`
235 |
236 | ```{r}
237 | ggplot(yearly_counts, aes(x=year, y=count, group=species_id)) +
238 | geom_line()
239 | ```
240 |
241 | We will be able to distiguish species in the plot if we add colors.
242 |
243 | ```{r}
244 | ggplot(yearly_counts, aes(x=year, y=count, group=species_id, color=species_id)) +
245 | geom_line()
246 | ```
247 |
248 | ## Faceting
249 |
250 | ggplot has a special technique called *faceting* that allows to split one plot
251 | into mutliple plots based on some factor. We will use it to plot one time series
252 | for each species separately.
253 |
254 | ```{r}
255 | ggplot(yearly_counts, aes(x=year, y=count, color=species_id)) +
256 | geom_line() + facet_wrap(~species_id)
257 | ```
258 |
259 | Now we wuld like to split line in each plot by sex of each individual
260 | measured. To do that we need to make counts in dataframe grouped by sex.
261 |
262 | > ### Challenges:
263 | >
264 | > - filter the dataframe so that we only keep records with sex "F" or "M"s
265 | >
266 |
267 | ```{r}
268 | sex_values = c("F", "M")
269 | surveys <- surveys %>%
270 | filter(sex %in% sex_values)
271 | ```
272 |
273 | > - group by year, species_id, sex
274 |
275 | ```{r}
276 | yearly_sex_counts <- surveys %>%
277 | group_by(year, species_id, sex) %>%
278 | summarise(count=n())
279 | ```
280 |
281 | > - make the faceted plot spliting further by sex (within single plot)
282 |
283 | ```{r}
284 | ggplot(yearly_sex_counts, aes(x=year, y=count, color=species_id, group=sex)) +
285 | geom_line() + facet_wrap(~ species_id)
286 | ```
287 |
288 | > We can improve the plot by coloring by sex instead of species (species are
289 | > already in separate plots, so we don't need to distinguish them better)
290 |
291 | ```{r}
292 | ggplot(yearly_sex_counts, aes(x=year, y=count, color=sex, group=sex)) +
293 | geom_line() + facet_wrap(~ species_id)
294 | ```
295 |
--------------------------------------------------------------------------------
/CONDUCT.Rmd:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | As contributors and maintainers of this project, we pledge to respect all people
4 | who contribute through reporting issues, posting feature requests, updating
5 | documentation, submitting pull requests or patches, and other activities.
6 |
7 | We are committed to making participation in this project a harassment-free
8 | experience for everyone, regardless of level of experience, gender, gender
9 | identity and expression, sexual orientation, disability, personal appearance,
10 | body size, race, ethnicity, age, or religion.
11 |
12 | Examples of unacceptable behavior by participants include the use of sexual
13 | language or imagery, derogatory comments or personal attacks, trolling, public
14 | or private harassment, insults, or other unprofessional conduct.
15 |
16 | Project maintainers have the right and responsibility to remove, edit, or reject
17 | comments, commits, code, wiki edits, issues, and other contributions that are
18 | not aligned to
19 | our [Code of Conduct](https://software-carpentry.org/conduct/). Project
20 | maintainers who do not follow the Code of Conduct may be removed from the
21 | project team.
22 |
23 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
24 | reported by following
25 | our [reporting guidelines](https://software-carpentry.org/CoC-reporting/).
26 |
--------------------------------------------------------------------------------
/CONDUCT.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
319 |
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
320 |
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
321 |
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to our Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
322 |
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by following our reporting guidelines.
9 | Python is a popular language for
10 | scientific computing, and great for general-purpose programming as
11 | well. Installing all of its scientific packages individually can be
12 | a bit difficult, so we recommend an all-in-one installer.
13 |
14 |
15 |
16 | Regardless of how you choose to install it,
17 | please make sure you install Python version 2.x and not version 3.x
18 | (e.g., 2.7 is fine but not 3.4).
19 | Python 3 introduced changes that will break some of the code we teach during the workshop.
20 |
21 |
22 |
23 | We will teach Python using the IPython notebook, a programming environment
24 | that runs in a web browser. For this to work you will need a reasonably
25 | up-to-date browser. The current versions of the Chrome, Safari and
26 | Firefox browsers are all supported
28 | (some older browsers, including Internet Explorer version 9
29 | and below, are not).
30 |
41 | Download the default Python 2 installer (do not follow the link to version 3).
42 | Use all of the defaults for installation
43 | except make sure to check
44 | Make Anaconda the default Python.
45 |
59 | Download the default Python 2 installer (do not follow the link to version 3).
60 | Use all of the defaults for installation.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Linux
69 |
70 | We recommend the all-in-one scientific Python installer
71 | Anaconda.
72 | (Installation requires using the shell and if you aren't
73 | comfortable doing the installation yourself just
74 | download the installer and we'll help you at the boot
75 | camp.)
76 |
77 |
78 |
79 | Download the installer that matches your operating
80 | system and save it in your home folder.
81 | Download the default Python 2 installer (do not follow the link to version 3).
82 |
83 |
84 | Open a terminal window.
85 |
86 |
87 | Type
bash Anaconda-
and then press
88 | tab. The name of the file you just downloaded should
89 | appear.
90 |
91 |
92 | Press enter. You will follow the text-only prompts. When
93 | there is a colon at the bottom of the screen press the down
94 | arrow to move down through the text. Type yes and
95 | press enter to approve the license. Press enter to approve the
96 | default location for the files. Type yes and
97 | press enter to prepend Anaconda to your PATH
98 | (this makes the Anaconda distribution the default Python).
99 |
7 | R is a programming language
8 | that is especially powerful for data exploration, visualization, and
9 | statistical analysis. To interact with R, we use
10 | RStudio.
11 |
12 |
13 |
14 |
15 |
Windows
16 |
17 | Install R by downloading and running
18 | this .exe file
19 | from CRAN.
20 | Also, please install the
21 | RStudio IDE.
22 |
23 |
24 |
25 |
Mac OS X
26 |
27 | Install R by downloading and running
28 | this .pkg file
29 | from CRAN.
30 | Also, please install the
31 | RStudio IDE.
32 |
33 |
34 |
35 |
Linux
36 |
37 | You can download the binary files for your distribution
38 | from CRAN. Or
39 | you can use your package manager (e.g. for Debian/Ubuntu
40 | run sudo apt-get install r-base and for Fedora run
41 | sudo yum install R). Also, please install the
42 | RStudio IDE.
43 |
7 | When you're writing scripts or text, it's nice to have a text
8 | editor that is optimized for writing code, with features
9 | like automatic color-coding of key words.
10 | The default text editor on Mac OS X and Linux is usually set to Vim,
11 | which is not famous for being intuitive.
12 | if you accidentally find yourself stuck in it,
13 | try typing the escape key,
14 | followed by ':q!' (colon, lower-case 'q', exclamation mark),
15 | then hitting Return
16 | to return to the shell. (This will lose any unsaved changes to the file.)
17 |
18 |
The Bash Shell
19 |
20 | Bash is a commonly-used shell. Using a shell gives you
21 | more power to do more tasks more quickly with your
22 | computer.
23 |
24 |
25 |
26 |
R
27 |
28 | R is a programming language that specializes in statistical
29 | computing. It is a powerful tool for exploratory data analysis. To
30 | interact with R, we will
31 | use RStudio, an interactive
32 | development environment (IDE).
33 |
34 |
SQL
35 |
36 | SQL is a specialized programming language used with databases.
37 | We use a simple database manager called SQLite,
38 | either directly or through a browser plugin.
39 |
40 |
OpenRefine
41 |
42 | OpenRefine (formerly Google Refine) is a powerful tool for exploring and working with messy data.
43 |
44 |
45 |
46 |
47 |
48 |
Windows
49 |
50 |
51 |
52 |
Editor
53 |
54 | Notepad++ is a
55 | popular free code editor for Windows.
56 | Be aware that you must add its installation directory to your system path
57 | in order to launch it from the command line
58 | (or have other tools like Git launch it for you).
59 | Please ask your instructor to help you do this.
60 |
61 |
Git Bash
62 |
63 | Install Git (version control) and a Bash shell for Windows from
64 | the msysGit project's homepage.
65 | This will provide you with Bash in the Git Bash program.
66 |
67 |
Software Carpentry Installer
68 |
Other tools used in Data Carpentry have been packaged up by
69 | Software Carpentry in an installer. This installer requires an active internet connection.
85 | Install R by downloading and running
86 | this .exe file
87 | from CRAN.
88 | Also, please install the
89 | RStudio IDE.
90 |
91 |
SQLite
92 |
93 | Install the Firefox SQLite browser plugin described below.
94 |
95 |
OpenRefine
96 |
97 | Download the OpenRefine software described below.
98 |
99 |
100 |
101 |
102 |
Mac OS X
103 |
104 |
105 |
106 |
Bash
107 |
108 | The default shell in all versions of Mac OS X is bash,
109 | so no need to install anything. You access bash from
110 | the Terminal (found
111 | in /Applications/Utilities). You may want
112 | to keep Terminal in your dock for this workshop.
113 |
114 |
Editor
115 |
116 | We recommend
117 | Text Wrangler or
118 | Sublime Text.
119 | In a pinch, you can use nano,
120 | which should be pre-installed.
121 |
122 |
123 |
124 |
R
125 |
126 | Install R by downloading and running
127 | this .pkg file
128 | from CRAN.
129 | Also, please install the
130 | RStudio IDE.
131 |
132 |
SQLite
133 |
134 | sqlite3 comes pre-installed on Mac OS X.
135 | Also install the Firefox SQLite browser plugin described below.
136 |
137 |
OpenRefine
138 |
139 | Download the OpenRefine software described below.
140 |
141 |
142 |
143 |
144 |
Linux
145 |
146 |
147 |
148 |
Bash
149 |
150 | The default shell is usually bash,
151 | but if your machine is set up differently
152 | you can run it by opening a terminal and typing bash.
153 | There is no need to install anything.
154 |
155 |
Editor
156 |
157 | Kate is one option for Linux users.
158 | In a pinch, you can use nano,
159 | which should be pre-installed.
160 |
161 |
162 |
163 |
R
164 |
165 | You can download the binary files for your distribution
166 | from CRAN. Or
167 | you can use your package manager, e.g. for Debian/Ubuntu
168 | run apt-get install r-base. Also, please install
169 | the
170 | RStudio IDE.
171 |
172 |
SQLite
173 |
174 | sqlite3 comes pre-installed on Linux.
175 | Also install the Firefox SQLite browser plugin described below.
176 |
177 |
OpenRefine
178 |
179 | Download the OpenRefine software described below.
180 |
181 |
182 |
183 |
184 |
Miscellaneous
185 |
186 |
187 |
188 |
Firefox SQLite Plugin
189 |
190 | Instead of using sqlite3 from the command line,
191 | you may use this plugin
192 | for Firefox instead.
193 | To install it:
194 |
206 | Click "Install Now" on the dialog that appears after the download completes.
207 |
208 |
209 | Restart Firefox when prompted.
210 |
211 |
212 | Select "SQLite Manager" from the "Tools" menu.
213 |
214 |
215 |
216 |
217 |
OpenRefine
218 |
219 | Head to the OpenRefine download page for information on how to install it. It will run through a browser, but will not need to use an internet connection, and your data will also be securely stored on your own computer.
220 |
5 | Spreadsheets are useful for data entry and data organization, and
6 | some subsetting and sorting of the data as well as getting an overview of the data. To interact with spreadsheets, we can use
7 | LibreOffice,
8 | Microsoft Excel,
9 | Gnumeric,
10 | OpenOffice.org, or other programs.
11 | Commands may differ a bit between programs, but general ideas for thinking about spreadsheets is the same.
12 |
13 |
14 | For this lesson, if you don't have a spreadsheet program already, you can use LibreOffice. It's a free, open source spreadsheet program.
15 |
16 |
17 |
18 |
Windows
19 |
20 |
21 |
Download the Installer
22 | Install LibreOffice by going to the installation page. The version for Windows
23 | should automatically be selected. Click Download Version 4.4.2. You
24 | will go to a page that asks about a donation, but you don't need to make one.
25 | Your download should begin automatically.
26 |
Install LibreOffice
27 | Once the installer is downloaded, double click on it and it should install.
28 |
29 |
30 |
31 |
32 |
33 |
Mac OS X
34 |
35 |
36 |
Download the Installer
37 | Install LibreOffice by going to the installation page. The version for Mac OS X
39 | should automatically be selected. Click Download Version 4.4.2. You
40 | will go to a page that asks about a donation, but you don't need to make one.
41 | Your download should begin automatically.
42 |
Install LibreOffice
43 | The file LibreOffice_4.4.2_MacOS_x86-64 should have been downloaded. Double click on this file, and LibreOffice will be installed.
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
Linux
52 |
53 |
54 |
Download the Installer
55 | Install LibreOffice by going to the installation page. The version for Linux
57 | should automatically be selected. Click Download Version 4.4.2. You
58 | will go to a page that asks about a donation, but you don't need to make one.
59 | Your download should begin automatically.
60 |
Install LibreOffice
61 | Once the installer is downloaded, double click on it and it shou\
62 | ld install.
63 |
11 |
12 |
13 |
14 |
15 | Data Carpentry's aim is to teach researchers basic concepts, skills,
16 | and tools for working with data so that they can get more done in less
17 | time, and with less pain. The lessons below were designed for those interested
18 | in working with genomics data in R.
19 |
20 | This is an introduction to R designed for participants with no programming
21 | experience. These lessons can be taught in a day (~ 6 hours). They start with
22 | some basic information about R syntax, the RStudio interface, and move through
23 | how to import CSV files, the structure of data frames, how to deal with factors,
24 | how to add/remove rows and columns, how to calculate summary statistics from a
25 | data frame, and a brief introduction to plotting. The last lesson demonstrates
26 | how to work with databases directly from R.
27 |
28 |
29 | ## Chapters
30 |
31 | 1. [Before we start](00-before-we-start.html)
32 | 2. [Introduction to R](01-intro-to-R.html)
33 | 3. [Starting with data](02-starting-with-data.html)
34 | 4. [Data frames](03-data-frames.html)
35 | 5. [The dplyr package](04-dplyr.html)
36 | 6. [Data visualization](05-data-visualization.html)
37 |
38 |
39 | ## Requirements
40 |
41 | Data Carpentry's teaching is hands-on, so participants are encouraged to use
42 | their own computers to ensure the proper setup of tools for an efficient
43 | workflow. *These lessons assume no prior knowledge of the skills or tools*, but
44 | working through this lesson requires working copies of the software described
45 | below. To most effectively use these materials, please make sure to download
46 | the data and install everything *before* working through this lesson.
47 |
48 | ### Data
49 |
50 | Data for the lesson is available [here](https://raw.githubusercontent.com/datacarpentry/R-genomics/gh-pages/data/Ecoli_metadata.csv).
51 |
52 | We will download this file directly from R during the lessons when we need
53 | it.
54 |
55 | ### Setup instructions
56 |
57 | **R** and **RStudio** are separate downloads and installations. R is the
58 | underlying statistical computing environment, but using R alone is no
59 | fun. RStudio is a graphical integrated development environment (IDE) that makes
60 | using R much easier and more interactive. You need to install R before you
61 | install RStudio. After installing both programs, you will need to install the
62 | **`tidyverse`** package from within RStudio. In the sections below are the instructions
63 | for installing R and R Studio on your operating system, as well as instructions for
64 | then installing **`tidyverse`** and **`RSQLite`**.
65 |
66 | #### Windows
67 |
68 | ##### If you already have R and RStudio installed
69 |
70 | * Open RStudio, and click on "Help" > "Check for updates". If a new version is
71 | available, quit RStudio, and download the latest version for RStudio.
72 | * To check which version of R you are using, start RStudio and the first thing
73 | that appears in the console indicates the version of R you are
74 | running. Alternatively, you can type `sessionInfo()`, which will also display
75 | which version of R you are running. Go on
76 | the [CRAN website](https://cran.r-project.org/bin/windows/base/) and check
77 | whether a more recent version is available. If so, please download and install
78 | it. You can [check here](https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-UNinstall-R_003f) for
79 | more information on how to remove old versions from your system if you wish to do so.
80 |
81 | ##### If you don't have R and RStudio installed
82 |
83 | * Download R from
84 | the [CRAN website](http://cran.r-project.org/bin/windows/base/release.htm).
85 | * Run the `.exe` file that was just downloaded
86 | * Go to the [RStudio download page](https://www.rstudio.com/products/rstudio/download/#download)
87 | * Under *Installers* select **RStudio x.yy.zzz - Windows
88 | XP/Vista/7/8** (where x, y, and z represent version numbers)
89 | * Double click the file to install it
90 | * Once it's installed, open RStudio to make sure it works and you don't get any
91 | error messages.
92 |
93 |
94 | #### macOS
95 |
96 | ##### If you already have R and RStudio installed
97 |
98 | * Open RStudio, and click on "Help" > "Check for updates". If a new version is
99 | available, quit RStudio, and download the latest version for RStudio.
100 | * To check the version of R you are using, start RStudio and the first thing
101 | that appears on the terminal indicates the version of R you are running. Alternatively, you can type `sessionInfo()`, which will also display which version of R you are running. Go on
102 | the [CRAN website](https://cran.r-project.org/bin/macosx/) and check
103 | whether a more recent version is available. If so, please download and install
104 | it.
105 |
106 | ##### If you don't have R and RStudio installed
107 |
108 | * Download R from
109 | the [CRAN website](http://cran.r-project.org/bin/macosx).
110 | * Select the `.pkg` file for the latest R version
111 | * Double click on the downloaded file to install R
112 | * It is also a good idea to install [XQuartz](https://www.xquartz.org/) (needed
113 | by some packages)
114 | * Go to the [RStudio download page](https://www.rstudio.com/products/rstudio/download/#download)
115 | * Under *Installers* select **RStudio x.yy.zzz - Mac OS X 10.6+ (64-bit)**
116 | (where x, y, and z represent version numbers)
117 | * Double click the file to install RStudio
118 | * Once it's installed, open RStudio to make sure it works and you don't get any
119 | error messages.
120 |
121 |
122 | #### Linux
123 |
124 | * Follow the instructions for your distribution
125 | from [CRAN](https://cloud.r-project.org/bin/linux), they provide information
126 | to get the most recent version of R for common distributions. For most
127 | distributions, you could use your package manager (e.g., for Debian/Ubuntu run
128 | `sudo apt-get install r-base`, and for Fedora `sudo yum install R`), but we
129 | don't recommend this approach as the versions provided by this are
130 | usually out of date. In any case, make sure you have at least R 3.3.1.
131 | * Go to the
132 | [RStudio download page](https://www.rstudio.com/products/rstudio/download/#download)
133 | * Under *Installers* select the version that matches your distribution, and
134 | install it with your preferred method (e.g., with Debian/Ubuntu `sudo dpkg -i
135 | rstudio-x.yy.zzz-amd64.deb` at the terminal).
136 | * Once it's installed, open RStudio to make sure it works and you don't get any
137 | error messages.
138 |
139 |
140 | #### For everyone
141 |
142 | **After installing R and RStudio, you need to install the `tidyverse` and
143 | `RSQLite` packages.**
144 |
145 | * After starting RStudio, at the console type:
146 | `install.packages(c("tidyverse", "RSQLite"))`
147 |
148 | ## Contributors
149 |
150 | The list of contributors to this lesson is available [here](http://datacarpentry.org/R-ecology-lesson/CITATION).
151 |
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/Lato.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/Lato.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/LatoBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/LatoBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/LatoItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/LatoItalic.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/NewsCycle.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/NewsCycle.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSans.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/Raleway.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/Raleway.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/RalewayBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/RalewayBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/Roboto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/Roboto.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/RobotoBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/RobotoBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/RobotoLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/RobotoLight.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/css/fonts/Ubuntu.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/css/fonts/Ubuntu.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/shim/html5shiv.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3 | */
4 | // Only run this code in IE 8
5 | if (!!window.navigator.userAgent.match("MSIE 8")) {
6 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
7 | };
8 |
--------------------------------------------------------------------------------
/site_libs/bootstrap-3.3.5/shim/respond.min.js:
--------------------------------------------------------------------------------
1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
3 | * */
4 |
5 | // Only run this code in IE 8
6 | if (!!window.navigator.userAgent.match("MSIE 8")) {
7 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b li {
207 | position: relative; }
208 |
209 | .fa-li {
210 | left: -2em;
211 | position: absolute;
212 | text-align: center;
213 | width: 2em;
214 | line-height: inherit; }
215 |
216 | .fa-border {
217 | border: solid 0.08em #eee;
218 | border-radius: .1em;
219 | padding: .2em .25em .15em; }
220 |
221 | .fa-pull-left {
222 | float: left; }
223 |
224 | .fa-pull-right {
225 | float: right; }
226 |
227 | .fa.fa-pull-left,
228 | .fas.fa-pull-left,
229 | .far.fa-pull-left,
230 | .fal.fa-pull-left,
231 | .fab.fa-pull-left {
232 | margin-right: .3em; }
233 |
234 | .fa.fa-pull-right,
235 | .fas.fa-pull-right,
236 | .far.fa-pull-right,
237 | .fal.fa-pull-right,
238 | .fab.fa-pull-right {
239 | margin-left: .3em; }
240 |
241 | .fa-spin {
242 | -webkit-animation: fa-spin 2s infinite linear;
243 | animation: fa-spin 2s infinite linear; }
244 |
245 | .fa-pulse {
246 | -webkit-animation: fa-spin 1s infinite steps(8);
247 | animation: fa-spin 1s infinite steps(8); }
248 |
249 | @-webkit-keyframes fa-spin {
250 | 0% {
251 | -webkit-transform: rotate(0deg);
252 | transform: rotate(0deg); }
253 | 100% {
254 | -webkit-transform: rotate(360deg);
255 | transform: rotate(360deg); } }
256 |
257 | @keyframes fa-spin {
258 | 0% {
259 | -webkit-transform: rotate(0deg);
260 | transform: rotate(0deg); }
261 | 100% {
262 | -webkit-transform: rotate(360deg);
263 | transform: rotate(360deg); } }
264 |
265 | .fa-rotate-90 {
266 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
267 | -webkit-transform: rotate(90deg);
268 | transform: rotate(90deg); }
269 |
270 | .fa-rotate-180 {
271 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
272 | -webkit-transform: rotate(180deg);
273 | transform: rotate(180deg); }
274 |
275 | .fa-rotate-270 {
276 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
277 | -webkit-transform: rotate(270deg);
278 | transform: rotate(270deg); }
279 |
280 | .fa-flip-horizontal {
281 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
282 | -webkit-transform: scale(-1, 1);
283 | transform: scale(-1, 1); }
284 |
285 | .fa-flip-vertical {
286 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
287 | -webkit-transform: scale(1, -1);
288 | transform: scale(1, -1); }
289 |
290 | .fa-flip-horizontal.fa-flip-vertical {
291 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
292 | -webkit-transform: scale(-1, -1);
293 | transform: scale(-1, -1); }
294 |
295 | :root .fa-rotate-90,
296 | :root .fa-rotate-180,
297 | :root .fa-rotate-270,
298 | :root .fa-flip-horizontal,
299 | :root .fa-flip-vertical {
300 | -webkit-filter: none;
301 | filter: none; }
302 |
303 | .fa-stack {
304 | display: inline-block;
305 | height: 2em;
306 | position: relative;
307 | width: 2em; }
308 |
309 | .fa-stack-1x,
310 | .fa-stack-2x {
311 | bottom: 0;
312 | left: 0;
313 | margin: auto;
314 | position: absolute;
315 | right: 0;
316 | top: 0; }
317 |
318 | .svg-inline--fa.fa-stack-1x {
319 | height: 1em;
320 | width: 1em; }
321 |
322 | .svg-inline--fa.fa-stack-2x {
323 | height: 2em;
324 | width: 2em; }
325 |
326 | .fa-inverse {
327 | color: #fff; }
328 |
329 | .sr-only {
330 | border: 0;
331 | clip: rect(0, 0, 0, 0);
332 | height: 1px;
333 | margin: -1px;
334 | overflow: hidden;
335 | padding: 0;
336 | position: absolute;
337 | width: 1px; }
338 |
339 | .sr-only-focusable:active, .sr-only-focusable:focus {
340 | clip: auto;
341 | height: auto;
342 | margin: 0;
343 | overflow: visible;
344 | position: static;
345 | width: auto; }
346 |
--------------------------------------------------------------------------------
/site_libs/font-awesome-5.0.13/fonts/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/font-awesome-5.0.13/fonts/fa-brands-400.ttf
--------------------------------------------------------------------------------
/site_libs/font-awesome-5.0.13/fonts/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/font-awesome-5.0.13/fonts/fa-regular-400.ttf
--------------------------------------------------------------------------------
/site_libs/font-awesome-5.0.13/fonts/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/font-awesome-5.0.13/fonts/fa-solid-900.ttf
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/README:
--------------------------------------------------------------------------------
1 | This a jQuery UI custom build, downloaded from:
2 | http://jqueryui.com/download/#!version=1.11.4&components=1111111111110111111111111111111111111
3 |
4 | It includes all components except the datepicker, because it conflicts with
5 | bootstrap-datepicker that is packaged with Shiny.
6 |
7 | The copy of jQuery that is bundled with the download, under external/, is not
8 | included because Shiny already has its own copy of jQuery.
9 |
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_444444_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_444444_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_555555_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_555555_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_777620_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_777620_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_777777_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_777777_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_cc0000_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_cc0000_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/R-genomics/cd4213a7f95ddcb70e8d771b48014ff619692fac/site_libs/jqueryui-1.11.4/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/site_libs/jqueryui-1.11.4/jquery-ui.structure.min.css:
--------------------------------------------------------------------------------
1 | /*! jQuery UI - v1.11.4 - 2016-01-05
2 | * http://jqueryui.com
3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */
4 |
5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:0.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:0.4em 2.1em 0.4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}
--------------------------------------------------------------------------------
/site_libs/navigation-1.1/codefolding.js:
--------------------------------------------------------------------------------
1 |
2 | window.initializeCodeFolding = function(show) {
3 |
4 | // handlers for show-all and hide all
5 | $("#rmd-show-all-code").click(function() {
6 | $('div.r-code-collapse').each(function() {
7 | $(this).collapse('show');
8 | });
9 | });
10 | $("#rmd-hide-all-code").click(function() {
11 | $('div.r-code-collapse').each(function() {
12 | $(this).collapse('hide');
13 | });
14 | });
15 |
16 | // index for unique code element ids
17 | var currentIndex = 1;
18 |
19 | // select all R code blocks
20 | var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan');
21 | rCodeBlocks.each(function() {
22 |
23 | // create a collapsable div to wrap the code in
24 | var div = $('');
25 | if (show)
26 | div.addClass('in');
27 | var id = 'rcode-643E0F36' + currentIndex++;
28 | div.attr('id', id);
29 | $(this).before(div);
30 | $(this).detach().appendTo(div);
31 |
32 | // add a show code button right above
33 | var showCodeText = $('' + (show ? 'Hide' : 'Code') + '');
34 | var showCodeButton = $('');
35 | showCodeButton.append(showCodeText);
36 | showCodeButton
37 | .attr('data-toggle', 'collapse')
38 | .attr('data-target', '#' + id)
39 | .attr('aria-expanded', show)
40 | .attr('aria-controls', id);
41 |
42 | var buttonRow = $('');
43 | var buttonCol = $('');
44 |
45 | buttonCol.append(showCodeButton);
46 | buttonRow.append(buttonCol);
47 |
48 | div.before(buttonRow);
49 |
50 | // update state of button on show/hide
51 | div.on('hidden.bs.collapse', function () {
52 | showCodeText.text('Code');
53 | });
54 | div.on('show.bs.collapse', function () {
55 | showCodeText.text('Hide');
56 | });
57 | });
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/site_libs/navigation-1.1/sourceembed.js:
--------------------------------------------------------------------------------
1 |
2 | window.initializeSourceEmbed = function(filename) {
3 | $("#rmd-download-source").click(function() {
4 | var src = $("#rmd-source-code").html();
5 | var a = document.createElement('a');
6 | a.href = "data:text/x-r-markdown;base64," + src;
7 | a.download = filename;
8 | document.body.appendChild(a);
9 | a.click();
10 | document.body.removeChild(a);
11 | });
12 | };
13 |
--------------------------------------------------------------------------------
/site_libs/navigation-1.1/tabsets.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | /**
4 | * jQuery Plugin: Sticky Tabs
5 | *
6 | * @author Aidan Lister
7 | * adapted by Ruben Arslan to activate parent tabs too
8 | * http://www.aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/
9 | */
10 | (function($) {
11 | "use strict";
12 | $.fn.rmarkdownStickyTabs = function() {
13 | var context = this;
14 | // Show the tab corresponding with the hash in the URL, or the first tab
15 | var showStuffFromHash = function() {
16 | var hash = window.location.hash;
17 | var selector = hash ? 'a[href="' + hash + '"]' : 'li.active > a';
18 | var $selector = $(selector, context);
19 | if($selector.data('toggle') === "tab") {
20 | $selector.tab('show');
21 | // walk up the ancestors of this element, show any hidden tabs
22 | $selector.parents('.section.tabset').each(function(i, elm) {
23 | var link = $('a[href="#' + $(elm).attr('id') + '"]');
24 | if(link.data('toggle') === "tab") {
25 | link.tab("show");
26 | }
27 | });
28 | }
29 | };
30 |
31 |
32 | // Set the correct tab when the page loads
33 | showStuffFromHash(context);
34 |
35 | // Set the correct tab when a user uses their back/forward button
36 | $(window).on('hashchange', function() {
37 | showStuffFromHash(context);
38 | });
39 |
40 | // Change the URL when tabs are clicked
41 | $('a', context).on('click', function(e) {
42 | history.pushState(null, null, this.href);
43 | showStuffFromHash(context);
44 | });
45 |
46 | return this;
47 | };
48 | }(jQuery));
49 |
50 | window.buildTabsets = function(tocID) {
51 |
52 | // build a tabset from a section div with the .tabset class
53 | function buildTabset(tabset) {
54 |
55 | // check for fade and pills options
56 | var fade = tabset.hasClass("tabset-fade");
57 | var pills = tabset.hasClass("tabset-pills");
58 | var navClass = pills ? "nav-pills" : "nav-tabs";
59 |
60 | // determine the heading level of the tabset and tabs
61 | var match = tabset.attr('class').match(/level(\d) /);
62 | if (match === null)
63 | return;
64 | var tabsetLevel = Number(match[1]);
65 | var tabLevel = tabsetLevel + 1;
66 |
67 | // find all subheadings immediately below
68 | var tabs = tabset.find("div.section.level" + tabLevel);
69 | if (!tabs.length)
70 | return;
71 |
72 | // create tablist and tab-content elements
73 | var tabList = $('
');
74 | $(tabs[0]).before(tabList);
75 | var tabContent = $('');
76 | $(tabs[0]).before(tabContent);
77 |
78 | // build the tabset
79 | var activeTab = 0;
80 | tabs.each(function(i) {
81 |
82 | // get the tab div
83 | var tab = $(tabs[i]);
84 |
85 | // get the id then sanitize it for use with bootstrap tabs
86 | var id = tab.attr('id');
87 |
88 | // see if this is marked as the active tab
89 | if (tab.hasClass('active'))
90 | activeTab = i;
91 |
92 | // remove any table of contents entries associated with
93 | // this ID (since we'll be removing the heading element)
94 | $("div#" + tocID + " li a[href='#" + id + "']").parent().remove();
95 |
96 | // sanitize the id for use with bootstrap tabs
97 | id = id.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_');
98 | tab.attr('id', id);
99 |
100 | // get the heading element within it, grab it's text, then remove it
101 | var heading = tab.find('h' + tabLevel + ':first');
102 | var headingText = heading.html();
103 | heading.remove();
104 |
105 | // build and append the tab list item
106 | var a = $('' + headingText + '');
107 | a.attr('href', '#' + id);
108 | a.attr('aria-controls', id);
109 | var li = $('');
110 | li.append(a);
111 | tabList.append(li);
112 |
113 | // set it's attributes
114 | tab.attr('role', 'tabpanel');
115 | tab.addClass('tab-pane');
116 | tab.addClass('tabbed-pane');
117 | if (fade)
118 | tab.addClass('fade');
119 |
120 | // move it into the tab content div
121 | tab.detach().appendTo(tabContent);
122 | });
123 |
124 | // set active tab
125 | $(tabList.children('li')[activeTab]).addClass('active');
126 | var active = $(tabContent.children('div.section')[activeTab]);
127 | active.addClass('active');
128 | if (fade)
129 | active.addClass('in');
130 |
131 | if (tabset.hasClass("tabset-sticky"))
132 | tabset.rmarkdownStickyTabs();
133 | }
134 |
135 | // convert section divs with the .tabset class to tabsets
136 | var tabsets = $("div.section.tabset");
137 | tabsets.each(function(i) {
138 | buildTabset($(tabsets[i]));
139 | });
140 | };
141 |
142 |
--------------------------------------------------------------------------------
/site_libs/tocify-1.9.1/jquery.tocify.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jquery.tocify.css 1.9.1
3 | * Author: @gregfranko
4 | */
5 |
6 | /* The Table of Contents container element */
7 | .tocify {
8 | width: 20%;
9 | max-height: 90%;
10 | overflow: auto;
11 | margin-left: 2%;
12 | position: fixed;
13 | border: 1px solid #ccc;
14 | webkit-border-radius: 6px;
15 | moz-border-radius: 6px;
16 | border-radius: 6px;
17 | }
18 |
19 | /* The Table of Contents is composed of multiple nested unordered lists. These styles remove the default styling of an unordered list because it is ugly. */
20 | .tocify ul, .tocify li {
21 | list-style: none;
22 | margin: 0;
23 | padding: 0;
24 | border: none;
25 | line-height: 30px;
26 | }
27 |
28 | /* Top level header elements */
29 | .tocify-header {
30 | text-indent: 10px;
31 | }
32 |
33 | /* Top level subheader elements. These are the first nested items underneath a header element. */
34 | .tocify-subheader {
35 | text-indent: 20px;
36 | display: none;
37 | }
38 |
39 | /* Makes the font smaller for all subheader elements. */
40 | .tocify-subheader li {
41 | font-size: 12px;
42 | }
43 |
44 | /* Further indents second level subheader elements. */
45 | .tocify-subheader .tocify-subheader {
46 | text-indent: 30px;
47 | }
48 |
49 | /* Further indents third level subheader elements. You can continue this pattern if you have more nested elements. */
50 | .tocify-subheader .tocify-subheader .tocify-subheader {
51 | text-indent: 40px;
52 | }
53 |
54 | /* Twitter Bootstrap Override Style */
55 | .tocify .tocify-item > a, .tocify .nav-list .nav-header {
56 | margin: 0px;
57 | }
58 |
59 | /* Twitter Bootstrap Override Styles */
60 | .tocify .tocify-item a, .tocify .list-group-item {
61 | padding: 5px;
62 | }
63 |
64 | .tocify .nav-pills > li {
65 | float: none;
66 | }
67 |
68 | /* We don't override the bootstrap colors because this gives us the
69 | wrong selection colors when using bootstrap themes
70 |
71 | .tocify .list-group-item:hover, .tocify .list-group-item:focus {
72 | background-color: #f5f5f5;
73 | }
74 |
75 | .tocify .list-group-item.active:hover, .tocify .list-group-item.active:focus {
76 | background-color: #428bca;
77 | }
78 | */
79 |
80 | /* End Twitter Bootstrap Override Styles */
81 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 15px;
3 | }
4 |
5 | p {
6 | font-size: 1.1em;
7 | }
8 |
9 | pre {
10 | font-size: 15px;
11 | }
--------------------------------------------------------------------------------