Skip to content

Commit

Permalink
updated the markdown to look better, added a website to cond
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahsupp committed Mar 17, 2014
1 parent e5e8823 commit 1dbcb78
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
10 changes: 10 additions & 0 deletions instructor_notes/R/00-first-timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ Some additional information on data frames:
* Rownames are usually 1..n.

__Combining data frames__
-------------

df <- data.frame(id = letters[1:10], x = 1:10, y = 11:20)
df

__Useful functions__
-------------

* head() - see first 6 rows
* tail() - see last 6 rows
Expand All @@ -388,11 +390,15 @@ See that it is actually a special list:


__Indexing__
-----------

Vectors have positions, these positions are ordered and can be called using name_vector[index]

names[2]

__Functions__
---------

A function is a saved object that takes inputs to perform a task.
Functions take in information and return desired outputs.

Expand All @@ -401,11 +407,15 @@ output = name_of_function(inputs)
y = sum(x)

__Help__
--------

All functions come with a help screen.
It is critical that you learn to read the help screens since they provide important information on what the function does,
how it works, and usually sample examples at the very bottom.

__Install new functions__
--------

To install any new package install.packages('ggplot2')

You can't ever learn all of R, but you can learn how to build a program and how to find help
Expand Down
2 changes: 1 addition & 1 deletion instructor_notes/R/01-starting-with-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The first few rows of our first file look like this:
0,0,2,0,4,2,2,1,6,7,10,7,9,13,8,8,15,10,10,7,17,4,4,7,6,15,6,4,9,11,3,5,6,3,3,4,2,3,2,1
0,1,1,3,3,1,3,5,2,4,4,7,6,5,3,10,8,10,6,17,9,14,9,7,13,9,12,6,7,7,9,6,3,2,2,4,2,0,1,1`

We want to:
__We want to:__

* load that data into memory,
* calculate the average inflammation per day across all patients, and
Expand Down
16 changes: 9 additions & 7 deletions instructor_notes/R/04-cond-colors-R.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ In this example, we are using a logical vector c(T, F) to access elements of the

R has lots of ways to refer to colors:

* http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
* http://colorbrewer2.org
* http://www.stat.tamu.edu/~jkim/Rcolorstyle.pdf
* http://alyssafrazee.com/RSkittleBrewer.html
* [r-chart](http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf)
* [color brewer](http://colorbrewer2.org)
* [color styles](http://www.stat.tamu.edu/~jkim/Rcolorstyle.pdf)
* [skittles theme colors](http://alyssafrazee.com/RSkittleBrewer.html)
* [i want hue](http://tools.medialab.sciences-po.fr/iwanthue/)


Control Structures
Expand Down Expand Up @@ -261,7 +262,7 @@ We can even put one loop inside another:
}
}

As the diagram below shows, the inner loop runs from start to finish each time the outer loop runs once:
The inner loop runs from start to finish each time the outer loop runs once:
_draw a diagram with boxes and arrows for what is happening_

We can combine nesting and conditionals to create patterns in an image:
Expand Down Expand Up @@ -331,6 +332,7 @@ This may be what we asked for, but both the image and the code are hideous:
* Our first heatmap had time along the X axis; this seems to have time along the Y axis.
* Red against blue is pretty hard on the eyes.
* The heatmap only shows two colors because none of the (integer) measurements has exactly the same value as the (fractional) mean.
* Red-green color blindness is not uncommon (5-10% males!) [try the simulator](http://www.etre.com/tools/colourblindsimulator/)
* We are calculating the mean of data either once or twice each time we go through the loop. That means that on a 40×60 data set, we are performing the same calculation 2400 times.

Here's how we can improve it:
Expand Down Expand Up @@ -459,11 +461,11 @@ Challenges
Key Points
-------------
* Learn how to source code
* Use the block_grid class from the rblocks source code to create simple "images" made of colored blocks.
* Use the `block_grid` class from the rblocks source code to create simple "images" made of colored blocks.
* Specify colors use (red, green, blue) triples, each component of which is an integer in the range 0..255.
* Use `if` condition to start a conditional statement, `elif` condition to provide additional tests, and `else` to provide a default.
* The bodies of the branches of conditional statements must be indented.
* Use == to test for equality.
* Use `==` to test for equality.
* X and Y is only true if both X and Y are true.
* X or Y is true if either X or Y, or both, are true.
* Nest loops to operate on multi-dimensional data.
Expand Down
9 changes: 4 additions & 5 deletions instructor_notes/version_control/1-why_version_control.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#Teaching Git - 1

##Take 30 seconds and explain to your neighbor what your workflow is like when you collaborate. What tools do you use? How do you communicate?
__3 groups share their answers__

__write on board__
1. Take 30 seconds and explain to your neighbor what your workflow is like when you collaborate. What tools do you use? How do you communicate?
2.
_3 groups share their answers_

##What is Version Control?
__any guesses?__
_any guesses?_

__Some questions__

Expand Down
6 changes: 3 additions & 3 deletions instructor_notes/version_control/3-remote_repos.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Since we just pulled the repository down, we will be up to date unless there has

=========================

- Give a little tour of [GitHub][].
- Have everyone make [GitHub][] accounts.
- Give a little tour of [GitHub](github.com).
- Have everyone make [GitHub](github.com) accounts.

### Make and Clone

- Make a new demo repo on [GitHub][] explaining the process as you go
- Make a new demo repo on [GitHub](github.com) explaining the process as you go
(probably on your personal account).
- Have [GitHub][] put in a README so it can be cloned.
- Explain that much like a browser navigates to websites using a URL, git talks
Expand Down

0 comments on commit 1dbcb78

Please sign in to comment.