Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Class 5 - Swirl
# Swirl

##Instructions

This week you will be acquiring and submitting some work through Github. To do this you will need to have RStudio & Github connected. If you have not already done this, please follow the instructions [here](http://www.molecularecologist.com/2013/11/using-github-with-r-and-rstudio/) (Mac) or [here](http://www.r-bloggers.com/rstudio-and-github/) (Windows). This can be a non-trivial step, so save some time to do it. If you are having trouble either Tweet your anguish or email me directly. (The crucial step is that in RStudio under Tools -> Global Options -> Git/SVN you must fill in the both the boxes: Git executable and SVN executable with the locations of both of those files.)
To have RStudio & Github connected, please follow the instructions [here](http://www.molecularecologist.com/2013/11/using-github-with-r-and-rstudio/) (Mac) or [here](http://www.r-bloggers.com/rstudio-and-github/) (Windows). This can be a non-trivial step, so save some time to do it. If you are having trouble either Tweet your anguish or email me directly. (The crucial step is that in RStudio under Tools -> Global Options -> Git/SVN you must fill in the both the boxes: Git executable and SVN executable with the locations of both of those files.)

Once you have set up this connection we will be using an R package named Swirl, Swirl is an interactive R lesson generator. Your task will be to do an introductory lesson in R and pull the data back to the Github repository.

Expand All @@ -17,7 +17,7 @@ Once you have set up this connection we will be using an R package named Swirl,

**Step 5:** Paste the URL for your class4 repository under "Repository URL"

**Step 6:** Name the directory "Class 4 - Swirl" and save it to a place on your computer that you will be able to locate
**Step 6:** Name the directory "Swirl" and save it to a place on your computer that you will be able to locate

**Step 7:** Install the "Swirl" package either by typing `install.packages("swirl")` into the Console window or installing through the "packages" tab on the bottom right window.

Expand All @@ -29,7 +29,7 @@ Once you have set up this connection we will be using an R package named Swirl,

**Step 11:** Once you have completed several lessons and exited the swirl session, type the following code into the RStudio Console window to export your lesson data. (You may need to change the file path in the first line. To do so search for "history_database" and replace the file path to point at that location on your computer).

H <-read.table("~/.rstudio-desktop/history_database", sep=":", fill=T, stringsAsFactors=F)
H <-read.table("C:/Users/acer-pc/AppData/Local/RStudio-Desktop/history_database", sep=":", fill=T, stringsAsFactors=F)
names(H) <- c("time", "answer")
H$id <- "YOUR NAME"
write.csv(H, file = "lesson1.csv", row.names = FALSE)
Expand Down
13 changes: 13 additions & 0 deletions class5 - swirl.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
48 changes: 48 additions & 0 deletions lesson1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"time","answer","id"
1473946999165,"","YOUR NAME"
1473947261909,"plain text(7,8)","YOUR NAME"
1473947336931,"hey","YOUR NAME"
1473947390395,"","YOUR NAME"
1473947417159,"plain text()","YOUR NAME"
1473947451921,"End a line with two space setPackageName(to start a paragraph)","YOUR NAME"
1473947497216,"*italics* and _italics_","YOUR NAME"
1473947789205,"install.packages(rmarkdown)","YOUR NAME"
1473947882038,"install.packages(rmarkown)","YOUR NAME"
1473948019835,"[link](www.rstudio.com)","YOUR NAME"
1473948066768,"[link](www.rstudio.com)","YOUR NAME"
1473955395301,"install.packages(knitr)","YOUR NAME"
1473955476158,"install.packages(jsonlite)","YOUR NAME"
1473955496559,"install.packages(rmarkdown)","YOUR NAME"
1474493815176,"install.packages(knitr)","YOUR NAME"
1474557241178,"install.packages(swirl)","YOUR NAME"
1474557323634,"library(swirl)","YOUR NAME"
1474557355705,"library(swirl)","YOUR NAME"
1474557408786,"install.packages(swirl)","YOUR NAME"
1474557499306,"library(swirl)","YOUR NAME"
1474557528304,"install.packages(stringi)","YOUR NAME"
1474557544551,"library(swirl)","YOUR NAME"
1474557613315,"swirl()","YOUR NAME"
1474558307324,"5 + 7","YOUR NAME"
1474558448184,"x <- 5 + 7","YOUR NAME"
1474558480200,"x","YOUR NAME"
1474558497141,"y <- x - 3","YOUR NAME"
1474558503643,"y","YOUR NAME"
1474558565388,"z <- c(1.1, 9, 3.14)","YOUR NAME"
1474558591262,"?c","YOUR NAME"
1474558607146,"z","YOUR NAME"
1474558659032,"c(z, 555, z)","YOUR NAME"
1474558689060,"z * 2 + 100","YOUR NAME"
1474558750041,"my_sqrt <- sqrt(z - 1)","YOUR NAME"
1474558778295,"my_sqrt","YOUR NAME"
1474558815640,"my_div <- z / my_sqrt","YOUR NAME"
1474558844297,"my_div","YOUR NAME"
1474558969823,"c(1, 2, 3, 4) + c(0, 10)","YOUR NAME"
1474559020983,"c(1, 2, 3, 4) + c(0, 10, 100)","YOUR NAME"
1474559076927,"z * 2 + 1000","YOUR NAME"
1474559171254,"my_div","YOUR NAME"
1474559247142,"swirl()","YOUR NAME"
1474559471014,"bye","YOUR NAME"
1474559480317,"bye()","YOUR NAME"
1474559630837,"swirl()","YOUR NAME"
1474559730733,"bye()","YOUR NAME"
1474559949792,"H <-read.table(C:/Users/acer-pc/AppData/Local/RStudio-Desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME"