R Programming/Documentation
Obtaining Help
[edit | edit source]For each package you have a reference manual available as an HTML file from within R or as a PDF on the CRAN website. You also often have Vignettes or comprehensive articles in the R Journal, the Journal of Statistical Software, etc.
library(help="package_name")
vignette("np",package="np")
vignette(all=FALSE) # vignettes for all attached packages
vignette(all=TRUE) # vignettes for all packages on the computer
You can search for help inside all loaded packages using help() or ?. Usually you do not need to add quotes to function names, but sometimes it can be useful. args() gives the full syntax of a function.
help(lm)
?lm
?"for"
?"[["
args("lm")
function (formula, data, subset, weights, na.action, method = "qr",
model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE,
contrasts = NULL, offset, ...)
# NULL
apropos() and find() looks for all the functions in the loaded packages containing a keyword or a regular expression[1].
apropos("norm")
# [1] "dlnorm" "dnorm" "plnorm"
# [4] "pnorm" "qlnorm" "qnorm"
# [7] "qqnorm" "qqnorm.default" "rlnorm"
# [10] "rnorm" "normalizePath"
You can search for help in all installed packages using help.search() or its shortcut ??.
??"lm"
help.search("covariance")
RSiteSearch() looks for help in all packages and in the R mailing lists. The sos package improves the RSiteSearch() function with the findFn() function. ??? is a wrapper for findFn().
RSiteSearch("spline")
library("sos")
findFn("spline", maxPages = 2)
???"spline"(2)
hints() in the hints package suggests what to do with an object.
fit <- lm(y ~ x)
library("hints")
hints(fit) # returns a list of function using lm objects.
Handouts
[edit | edit source]- An Introduction to R The R Reference Manual
- Robert Kabacoff's Quick R
- Grant Farnsworth's Econometrics in R The best introduction for an economist (about 20 pages)
- UCLA R Computing Resources
- A Handbook of Statistical Analyses Using R by Brian S. Everitt and Torsten Hothorn
- fr+en Arthur Charpentier's R for acturies
- Dan Goldstein's video tutorial
- fr Julien Barnier's introduction to R for sociologists
- Rosetta Code presents solutions to the same task in different programming languages.
- 'R language for programmers', by John Cook
- A Brief Guide to R Beginners in Econometrics
- R Tutorial by Kelly Black
Teaching Resources
[edit | edit source]- François Briatte has a nice introduction to data analysis using R[2]
- Simon Jackman Political Methodology Classes
- Jonathan Katz Political Methodology Classes
- A Brief Guide to R for Beginners in Econometrics
- PRISM luncheons
- Statistical Analysis: an Introduction using R - which includes a course on R
- Biostatistics with R aka A R companion to Wayne Daniel 's Biostatistics Book
Blogs
[edit | edit source]- Planet R the first R blog aggregator
- R Bloggers The news pulse for the R blogosphere
- "R" you Ready ?
- One R Tip a Day
- Revolution computing blog
- Yu Sung Su's Blog:R
- (fr) Freakonometrics (in French) lots of code chunks
- (fr) Baptiste Coulmont (in French)
- (fr) Quanti Sciences Sociales (in French) R blog for sociologists
Journals
[edit | edit source]- The R Journal
- Journal of Statistical Software contains lots of articles on R packages.
- The Political Methodologist contains lots of articles on R for political scientists.
Books
[edit | edit source]- Venables and Ripley : Modern Applied Statistics with S
- A very good introduction to R covering numerous topics.
- A Handbook of Statistical Analyses Using R (Brian S. Everitt and Torsten Hothorn, Chapman & Hall/CRC, 2008)
- An Introduction to Data Technologies, by Paul Murrell
- Everything you need to know about data management
- A first course in statistical programming with R, John Braun and Duncan Murdoch.
- Peter Dalgaard (2009). ISwR: Introductory Statistics with R. R package version 2.0-4. http://CRAN.R-project.org/package=ISwR
- Springer Use R Series
- John Fox : An R and S-PLUS Companion to Applied Regression
- Gelman Hill : Data Analysis using Regression and Multilevel Hierarchical Models
useR and other R conferences
[edit | edit source]- useR! 2009
- useR! 2010
- London R homepage
- R / Finance conferences in 2009 and 2010
Search Engine
[edit | edit source]- R seek
- Google Code Search with keyword "lang:r" gives access to r programs including the request. For instance the following request
optim lang:r
gives access to all the r programs includingoptim
.
Q&A / Forums
[edit | edit source]- Nabble R http://r.789695.n4.nabble.com/
- Stackoverflow
- The #rstats hashtag on Twitter
- IRC: #r@freenode
- r-soc : mailing list for French sociologist
References
[edit | edit source]- ↑ If you want to know more about regular expressions, have a look at the Regular expressions section in the Text Processing page.
- ↑ Introduction to Data Analysis