Skip to content

Commit

Permalink
fixes issue swcarpentry#217
Browse files Browse the repository at this point in the history
  • Loading branch information
dounia committed Dec 30, 2017
1 parent 640b10a commit d99a03e
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _episodes_rmd/.Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source('../bin/chunk-options.R')
knitr_fig_path("11-supp-read-write-csv-")
``{r readData}
carSpeeds <- read.csv(file='data/car-speeds.csv', header=FALSE)
carSpeeds[1,]
```{r stringsAsFactorsTRUE}
carSpeeds <- read.csv(file='data/car-speeds.csv', stringsAsFactors=FALSE)
carSpeeds$Color<- ifelse(carSpeeds$Color=='Blue', 'Green', carSpeeds$Color)
carSpeeds$Color
carSpeeds$Color<- ifelse(carSpeeds$Color=='Blue', 'Green', carSpeeds$Color)
1 change: 1 addition & 0 deletions _episodes_rmd/05-cmdline.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ keypoints:

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("05-cmdline-")
```

The R Console and other interactive tools like RStudio are great for prototyping code and exploring data, but sooner or later we will want to use our program in a pipeline or run it in a shell script to process thousands of data files.
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/06-best-practices-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ keypoints:

```{r source, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("06-best-practices-R-")
```
### Keep track of who wrote your code and its intended purpose

Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/07-knitr-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ keypoints:

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("07-knitr-R-")
```

`knitr` is an R package that allows you to organize your notes, code, and results in a single document. It's a great tool for "literate programming" -- the idea that your code should be readable by humans as well as computers! It also keeps your writing and results together, so if you collect some new data or change how you clean the data, you just have to re-compile the document and you're up to date!
Expand Down
2 changes: 2 additions & 0 deletions _episodes_rmd/08-making-packages-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ keypoints:

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fit_path("08-making-packages-R-")
```


Why should you make your own R packages?

**Reproducible research!**
Expand Down
2 changes: 2 additions & 0 deletions _episodes_rmd/09-supp-intro-rstudio.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ keypoints:

```{r, include= FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("09-supp-intro-rstudio-")
```
```
Let's start by learning about our tool.
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/10-supp-addressing-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ keypoints:

```{r, include = FALSE}
source('../bin/chunk-options.R')
knitr_fig_path("10-supp-addressing-data-")
```

R is a powerful language for data manipulation.
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/11-supp-read-write-csv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ keypoints:

```{r, include = FALSE}
source('../bin/chunk-options.R')
knitr_fig_path("11-supp-read-write-csv-")
```

The most common way that scientists store data is in Excel spreadsheets.
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/13-supp-data-structures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ exercises: 0

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("13-supp-data-structures-")
```

### Understanding Basic Data Types in R
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/14-supp-call-stack.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ keypoints:

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("14-supp-call-stack-")
```

### The Call Stack
Expand Down
1 change: 1 addition & 0 deletions _episodes_rmd/15-supp-loops-in-depth.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ keypoints:

```{r, include = FALSE}
source("../bin/chunk-options.R")
knitr_fig_path("15-supp-loops-in-depth-")
```

In R you have multiple options when repeating calculations: vectorized operations, `for` loops, and `apply` functions.
Expand Down

0 comments on commit d99a03e

Please sign in to comment.