Notes and links on R.

## Meta

## Articles

## Books and manuals

- Introduction to statistical thinking using R; without calculus. Jun 2011.
- Teach Yourself R (pdf) is a nice Q&A styled short manual.
- Learn Statistics with R (pdf) is a 500+ page book on learning stats with R from researchers at Adelide University.
- R tutorial by Prof. Kelly Black
- Practical tools for exploring data and models, PhD thesis of Hadley Wickham.
- R for Data Science (Free online book by Garrett Grolemund & Hadley Wickham)
- Cookbook for R by Winston Chang; solutions to common tasks and problems in analyzing data.
- Using R for psychological research a tutorial.
- Book recommendations discussion.
- One Page R: A Survival Guide to Data Science with R
- Graphical Data Analysis with R; via Andrew Gelman
- Impatient R; a short tutorial.
- Introduction to R by Larry Wasserman.
- Manning | Practical Data Science with R

## Tools

- RStudio – user interface for R. It’s free and open source, and works on Windows, Mac, and Linux.
- Swirl – its purpose is to teach users statistics and R simultaneously and interactively.
- RKWard is nicer looking.
- R Commander is a tcl/tk based interface.
`sudo apt-get install r-cran-rcmdr`

- Interactive Documents with R see demo.
- Publish R documents (code+words)
- Knitr is an important tool for reproducible research. A brief guide
- Emacs can communicate with R using ESS.

## Learning R

## Classes

- Concepts in computing with data Stats 133, Spring 2011, Berkeley. R+XML+Databases. 350 page notes.
- Data Technologies for Statistical Analysis Stat585, Spring 2014, Iowa state by Dianne Cook.

## Blogs

- http://www.r-bloggers.com/. Aggregates R related blogs. feed
- http://rud.is/b/ – data science + infosec + R
- http://strengejacke.wordpress.com/tag/rstats/ [code]
- http://www.jameskeirstead.ca/tag/rstats/ [code, vis]
- http://www.r-statistics.com/
- http://andrewgelman.com/ - Andre Gelman is a popular author of Stats books and a regular blogger on applications of stats in “civilian” life.
- 24 days of R
- http://www.theanalysisfactor.com/tag/r/
- http://bayesianbiologist.com/
- Home - RWeekly.org

## Packages

R packages for undergraduate stat ed [Aug 2015]

- devtools to make your life as a package developer easier by providing R functions that simplify many common tasks
- sqldf is an R package for runing SQL statements on R data frames, optimized for convenience.
- ggplot2 popular graphing package; replacement for the default plotting routines.
- chloroplethr – for plotting spatial, geographical data.
- swirl – is a software package for the R statistical programming language. Its purpose is to teach users statistics and R simultaneously and interactively.
- dplyr set of tools for efficiently manipulating datasets in R. dplyr is the next iteration of plyr, focussing on only data frames.
- lubridate
- rcharts.io is an R package to create, customize and publish interactive javascript visualizations from R using a familiar lattice style plotting interface.
- sparkTable sparklines in R.
- slopegraph Tufte’s slopegraphs in R.
RCPP provides C++ classes that greatly facilitate interfacing C or C++ code in R packages using the .Call() interface provided by R.

## Code samples

- https://github.com/huebner/Rlabs – R code for undergrad statistics course
- https://github.com/timelyportfolio
- rstudio spark (google search) for R-shiny projects.
- Tale of two conferences: basketball use of R-Shiny
- Subsetting to clean your data

## Libraries

## Tech notes, papers and articles on R

- Revolution analytics white papers

## Installing R and contributed libraries.

R is made of r-core and thousands of contributed libraries. To begin with, we need to install the core application.

On Linux:

`$ sudo apt-get install r-base-core`

## R and PostgreSQL

Preparing R to query data from postgresql. Reference.

Installation

```
$ sudo apt-get install libpq-dev
$ sudo apt-get install r-base-core
$ export PG_LIB_DIR=/usr/lib/postgresql/8.4/lib/
$ export PG_INCLUDE_DIR=/usr/include/postgresql
```

Install R packages from the bash/zsh shell

```
export CRAN_MIRROR="http://cran.case.edu/"
echo "install.packages(\"rjson\", repos=\"$CRAN_MIRROR\")" | R --vanilla
```

R Session