Size: 1985
Comment:
|
Size: 3905
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
= Session 0: Basics = Understanding of this material will be assumed throughout the course. Please read these introductory materials and make sure you understand them before beginning the readings for the first session. |
= Session 0: Basics (with optional R primer) = |
Line 9: | Line 8: |
If there is sufficient interest, a short primer on using R will be offered during the first week of the course (somewhere between May 26 and May 30). If you're interested in this, or if you have requests on what to cover during the primer, please write to AustinFrank. | '''11:00, May 27 2008''' ''I'm going to be running this section of the course. All questions and comments should either be posted here, or sent directly to me.'' -- AustinFrank [[DateTime(2008-05-20T18:19:39Z)]] This optional meeting of the course will be an R primer. We'll be focusing on obtaining a basic level of familiarity required to participate in the course. We won't cover everything you'll need to know for the course, but hopefully we'll cover enough that you will be able to learn new material on your own. Whether you attend the R primer or not, you are responsible for understanding the content of these readings before the first session. If there are things you would like to cover, please make note of them below. ''NB'': As of now there are no plans to teach graphing functions during the primer. It's possible that we could have a special add-on session to discuss different graphics packages in R if there's sufficient interest. Let AustinFrank know if you want to participate in such an event. |
Line 12: | Line 19: |
Understanding of this material will be assumed throughout the course. Please read these introductory materials and make sure you understand them before beginning the readings for the first session. '''Here and for the other sessions, we sometimes assign parts of chapters for reading, so please check the page numbers for the suggested readings''' (or risk being confused). |
|
Line 14: | Line 23: |
|| Dal04 || ??? || ??? || | || Dal04 || Chapter 2 (pp. 45-55) || Probability distributions in R || For absolute beginners, this is also very useful: || Dal04 || Chapter 1.1 - 1.2 || Basics of R || || || Chapter 1.5 - 1.5 || || Additionally, feel free to download and print out this [attachment:R-Refcard.pdf reference card] for R. While it's a few years old, the basics it covers have not changed. |
Line 17: | Line 33: |
* Make sure you have the latest version of R (version 2.7) installed on a laptop that you can use during class. | * Make sure you have the latest version of R (version 2.7) installed on a laptop that you can use during class. AndrewWatts wrote some very useful [http://linginst07.stanford.edu/florianR/software/ instructions for installing R] last summer. You should still be able to follow those steps, but make sure you download and install version 2.7. = R Primer = == Suggested topics == If you have any material that you would like to cover that isn't included in the list below, please make note of it here. |
Line 22: | Line 42: |
command history, continuation lines, stopping execution defining variables |
command history, continuation lines, stopping execution [[BR]] defining variables [[BR]] |
Line 25: | Line 45: |
* Installing packages {{{install.package(), update.package()}}} |
|
Line 26: | Line 48: |
{{{ls(), rm(), setwd(), getwd()}}} | {{{ls(), rm(), setwd(), getwd(), library()}}} |
Line 41: | Line 63: |
{{{read.csv(), read.delim(), read.stata()}}} | {{{read.csv(), read.delim(), library(foreign)}}} |
Line 58: | Line 80: |
=== Probability distributions === * random sampling {{{runif(), rnorm(), rbinom()}}} |
Session 0: Basics (with optional R primer)
11:00, May 27 2008
I'm going to be running this section of the course. All questions and comments should either be posted here, or sent directly to me. -- AustinFrank DateTime(2008-05-20T18:19:39Z)
This optional meeting of the course will be an R primer. We'll be focusing on obtaining a basic level of familiarity required to participate in the course. We won't cover everything you'll need to know for the course, but hopefully we'll cover enough that you will be able to learn new material on your own.
Whether you attend the R primer or not, you are responsible for understanding the content of these readings before the first session.
If there are things you would like to cover, please make note of them below. NB: As of now there are no plans to teach graphing functions during the primer. It's possible that we could have a special add-on session to discuss different graphics packages in R if there's sufficient interest. Let AustinFrank know if you want to participate in such an event.
Reading
Understanding of this material will be assumed throughout the course. Please read these introductory materials and make sure you understand them before beginning the readings for the first session. Here and for the other sessions, we sometimes assign parts of chapters for reading, so please check the page numbers for the suggested readings (or risk being confused).
Baa08 |
Chapter 1 (pp. 1-20) |
Intro to R. |
G&H07 |
Chapter 2 (pp. 13-26) |
Intro to probability theory. |
Dal04 |
Chapter 2 (pp. 45-55) |
Probability distributions in R |
For absolute beginners, this is also very useful:
Dal04 |
Chapter 1.1 - 1.2 |
Basics of R |
|
Chapter 1.5 - 1.5 |
|
Additionally, feel free to download and print out this [attachment:R-Refcard.pdf reference card] for R. While it's a few years old, the basics it covers have not changed.
Assignments
Make sure you have the latest version of R (version 2.7) installed on a laptop that you can use during class. AndrewWatts wrote some very useful [http://linginst07.stanford.edu/florianR/software/ instructions for installing R] last summer. You should still be able to follow those steps, but make sure you download and install version 2.7.
R Primer
Suggested topics
If you have any material that you would like to cover that isn't included in the list below, please make note of it here.
Topics
Interacting with R and R files
- Using a command line
- Installing packages
install.package(), update.package()
- Using the R workspace
ls(), rm(), setwd(), getwd(), library()
- Using an R script file
- Saving R objects
save(), save.image()
Getting help
- Function-specific help
?(), help()
- Searching the help
apropos(), help.search(), RSiteSearch()
Loading data
- general purpose functions
scan()
- specific formats
read.csv(), read.delim(), library(foreign)
General data structures
- vectors / arrays
c()
- matrices
cbind(), rbind(), table()
- lists
list(), unlist()
- data frames
data.frame()
- general structure manipulation and interaction
[], [[]], $, subset(), str(), cut(), repr()
Basic descriptive statistics
- summary stats
mean(), sd(), var(), quantile()
Probability distributions
- random sampling
runif(), rnorm(), rbinom()