Getting help and documentation

Install required packages

sos

wants <- c("sos")
has   <- wants %in% rownames(installed.packages())
if(any(!has)) install.packages(wants[!has])

R’s own help system

Help system for R functions

help.start()
help(round)
?round
?"/"
# not shown (opens browser window)
args(round)
function (x, digits = 0) 
NULL
example(round)

round> round(.5 + -2:4) # IEEE rounding: -2  0  0  2  2  4  4
[1] -2  0  0  2  2  4  4

round> ( x1 <- seq(-2, 4, by = .5) )
 [1] -2.0 -1.5 -1.0 -0.5  0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0

round> round(x1) #-- IEEE rounding !
 [1] -2 -2 -1  0  0  0  1  2  2  2  3  4  4

round> x1[trunc(x1) != floor(x1)]
[1] -1.5 -0.5

round> x1[round(x1) != floor(x1 + .5)]
[1] -1.5  0.5  2.5

round> (non.int <- ceiling(x1) != floor(x1))
 [1] FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE
[12]  TRUE FALSE

round> x2 <- pi * 100^(-1:3)

round> round(x2, 3)
[1]       0.031       3.142     314.159   31415.927 3141592.654

round> signif(x2, 3)
[1] 3.14e-02 3.14e+00 3.14e+02 3.14e+04 3.14e+06

Getting help without knowing the function name

help.search("mean")
# not shown (opens browser window)
apropos("mean")
 [1] "colMeans"      ".colMeans"     "kmeans"        "mean"         
 [5] "mean.Date"     "mean.default"  "mean.difftime" "mean.POSIXct" 
 [9] "mean.POSIXlt"  "rowMeans"      ".rowMeans"     "weighted.mean"
library(sos)                  # for findFn()
findFn("Petal.Length")
# not shown (opens browser window)

Online documentation

Search, mailing lists and Q&A sites

Introductory websites and texts

Official documentation

Books

Introductory statistics

  • Dalgaard, P. (2008). Introductory Statistics with R (2nd ed.). London, UK: Springer. URL
  • Maindonald, J. & Braun, W. J. (2010). Data Analysis and Graphics Using R: An Example-Based Approach (3rd ed.). Cambridge, UK: Cambridge University Press. URL
  • Verzani. J. (2014). Using R for Introductory Statistics (2nd ed.). Boca Raton, FL: Chapman & Hall/CRC.
  • Wollschlaeger, D. (2012). Grundlagen der Datenanalyse mit R (2nd ed.). Berlin: Springer. URL

Specialized and advanced statistical topics

  • Chihara, L. & Hesterberg, T. (2011). Mathematical Statistics with Resampling and R. Hoboken, NJ: Wiley. URL
  • Galecki, A. T. & Burzykowski, T. (2013). Linear Mixed-Effects Models: A Step-by-Step Approach. New York, NY: Springer.
  • Everitt, B. S. & Hothorn, T. (2010). A Handbook of Statistical Analysis Using R (2nd ed.). Boca Raton, FL: Chapman & Hall/CRC.
  • Everitt, B. S. & Hothorn, T. (2011). An Introduction to Applied Multivariate Analysis with R. New York, NY: Springer.
  • Fox, J. & Weisberg, S. (2011). An R Companion to Applied Regression (2nd ed.). Thousand Oaks, CA: Sage. URL
  • Harrell, F. (2015). Regression Modeling Strategies (2nd ed.). New York, NY: Springer. URL
  • Long, J. D. (2012). Longitudinal Data Analysis for the Behavioral Sciences Using R. Thousand Oaks, CA: Sage. URL URL
  • Pinheiro, J. C. & Bates, D. M. (2000). Mixed-Effects Models in S and S-PLUS. New York, NY: Springer.
  • Shumway, R. H. & Stoffer, D. S. (2011). Time Series Analysis and Its Applications (3rd ed.). New York, NY: Springer. URL
  • Spector, P. (2008). Data Manipulation with R. New York, NY: Springer.
  • Venables, W. N. & Ripley, B. D. (2002). Modern Applied Statistics with S (4th ed.). New York, NY: Springer. URL

Diagrams

  • Murrell, P. (2011). R Graphics (2nd ed.). Boca Raton, FL: Chapman & Hall/CRC. URL
  • Sarkar, D. (2008). Lattice: Multivariate Data Visualization with R. New York, NY: Springer. URL
  • Wickham, H. (2009). ggplot2: Elegant Graphics for Data Analysis. New York, NY: Springer. URL

Programming with R

  • Chambers, J. M. (2008). Software for Data Analysis: Programming with R. New York, NY: Springer. URL
  • Ligges, U. (2014). Programmieren mit R (4. Aufl.). Berlin: Springer Spektrum. URL
  • Wickham, H. (2014). Advanced R programming. Boca Raton, FL: Chapman & Hall/CRC. URL

Transition from other statistical software packages

Dynamic documents and reproducible research

  • Gandrud, C. (2014). Reproducible research with R & RStudio. Boca Raton, FL: Chapman & Hall/CRC. URL
  • Stodden, V., Leisch, F. & Peng, R. D. (2014). Implementing Reproducible Research. Boca Raton, FL: Chapman & Hall/CRC.
  • Xie, Y. (2013). Dynamic Documents with R and knitr. Boca Raton, FL: Chapman & Hall/CRC.

Detach (automatically) loaded packages (if possible)

try(detach(package:sos))
try(detach(package:brew))

Get the article source from GitHub

R markdown - markdown - R code - all posts