Overview of the Day
DPI R Bootcamp
Jared Knowles
Welcome
Thanks for being here today and joining us in Madison Wisconsin for the first inaugural Wisconsin DPI R Bootcamp!
Outline
We hope to move through the following topics in the next couple of days.
- Introduction to R
- Getting Data In
- Handling Data in R
- Cleaning and Merging Data
- Analytics
- Visualizations
- Getting Results Out
- Writing Functions, Advanced Analytics, and other topics
Agenda
Day 1: December 3rd, 2012
- 8:30am Convene
- Topic 1: Introduction to R
- Coffee Break
- Topic 2: Getting Data In
- 12:00pm Lunch (on your own)
- 1:00pm Reconvene
- Topic 3: Manipulating Data
- Topic 4: Cleaning Data
- Break
- Topic 5: Basic Analytics
- 04:30pm Adjourn + Questions
Agenda (II)
Day 2: December 4th, 2012
- 8:30am Convene (optional)
- Intro to programming principles
- Coffee Break
- Intro to statistics
- 12:00pm Lunch
Agenda (III)
Day 2: December 4th, 2012
- 1:00pm Convene
- Topic 5: Basic Analytics (part 2)
- Topic 6: Visualization
- 4:30pm Q&A and Adjourn
Agenda (IV)
Day 3: December 5th, 2012
- 8:30am Convene
- Topic 6: Visualization (part2)
- Break
- Topic 7: Exporting/sharing Your Work
- Lunch
- Topic 8: Advanced Topics
- Break
- Work on projects
- 4:00pm Q & A
- 4:30pm Adjourn
Materials
If you don’t have it already, now might be a good time to install R and RStudio to get started.
- Download R
- RStudio
- We’ll also want to install a few basic packages. This can be done on the fly later, but a few include
ggplot2
;knitr
;plyr
Installation Tips
- Setting up R on Windows XP is straightforward. On Windows 7 or Vista you may need to run in administrator mode to install extensions.
- Standard R interface in Windows is pretty ugly, which is why we use RStudio!
Next Install packages
First, watch this tutorial
Install Packages
- Are you running RStudio in administrator mode on Windows Vista or Windows 7?
- If not, you need to be. Right click on RStudio and then click “Run as Administrator”
- If you are on a Mac or Windows XP you can disregard this
Install Packages (2)
- Now, copy and paste the code below into the bottom left window in RStudio (the R terminal):
install_new<-function(mypkg){
if (mypkg %in% installed.packages()) cat("Package already installed")
else{cat("Package not found, so installing with dependencies... /n
Press CTRL C to abort.")
Sys.sleep(5)
install.packages(mypkg,repos="http://cran.wustl.edu/")
}
}
install_new('plyr')
install_new('lmtest')
install_new('ggplot2')
install_new('gridExtra')
install_new('stringr')
install_new('knitr')
install_new('quantreg')
install_new('zoo')
install_new('xtable')
install_new('lme4')
install_new('caret')
How it Works
- I will present a mixture of concepts and examples that illustrate various features of R
- Periodically we will stop and do some exercises to practice what we have talked about
- You have been provided with the data used and all the code in the examples on the screen
- For each tutorial simply open the “Tutorial X.R” file associated with the tutorial number to get access to the R code associated with each slide
- We’ll talk about how to load the data
- You can follow along as I move through the slides, or wait until we pause for an example and run the code
- Please hold questions until either the exercise period or the end of each tutorial due to the large size of the class!
Housekeeping
- No food in the Training Center (drinks only with covered lids!)
- Feel free to get up at any time as necessary
- Let’s make sure now everyone can launch R, RStudio, and has downloaded and can access the materials for the training
- Also, make sure you are set up with the wi-fi password!
Have fun!
Let’s get started!