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)
function (x, digits = 0)
NULL
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)
[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
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
- Wollschlaeger, D. (2026). Grundlagen der Datenanalyse mit R (6th ed.). Berlin: Springer. URL
Specialized and advanced statistical topics
- Regressions models
- Fox J, Weisberg S. 2019. An R Companion to Applied Regression (3rd ed). Thousand Oaks, CA: Sage. URL
- Fox J. 2020. Regression diagnostics (2nd ed). URL
- Harrell Jr FE. 2015. Regression Modeling Strategies (2nd ed). New York: Springer. URL
- Multivariate analysis
- Zelterman D. 2015. Applied multivariate statistics with R. New York, NY: Springer.
- Linear mixed models
- Meier L. 2022. ANOVA and Mixed Models: A Short Introduction Using R . Boca Raton, FL: Chapman & Hall/CRC. URL
- Pinheiro JC, Bates, DM. 2000. Mixed-Effects Models in S and S-PLUS. New York, NY: Springer.
- West BT, Welch, KB, Galecki AT. 2022. Linear mixed models: A practical guide using statistical software (3rd ed). Boca Raton, FL: Chapman & Hall/CRC. URL
- Resampling methods
- Chihara L, Hesterberg T. 2022. Mathematical Statistics with Resampling and R (3. Aufl.). Hoboken, NJ: Wiley. URL
- Time series
- Shumway RH, Stoffer DS. 2016. Time series analysis and its applications (5th ed). New York, NY: Springer. URL
- Shumway RH, Stoffer DS. 2019. Time Series: A Data Analysis Approach Using R (2nd ed). Boca Raton, FL: Chapman & Hall/CRC. URL
- Hyndman RJ, Athanasopoulos G. 2019. Forecasting: Principles and practice (3rd ed). Melbourne, Australia: OTexts. URL
- Bayes methods
- Kruschke JK. 2015. Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan (2nd ed). Amsterdam: Academic Press. URL
- McElreath R. 2020. Statistical rethinking: A Bayesian course with examples in R and Stan (2nd ed). Boca Raton, FL: Chapman & Hall/CRC. URL
- Spatial statistics
- Lovelace R, Nowosad J, Muenchow J. 2025. Geocomputation with R. 2. Aufl. Boca Raton, FL: Chapman & Hall/CRC. URL
- Pebesma E, Bivand RS. 2023. Spatial Data Science With Applications in R. Boca Raton, FL: Chapman & Hall/CRC. URL
- R for data science and machine learning:
- James G, Witten D, Hastie T, Tibshirani R. 2021. An introduction to statistical learning with applications in R (2nd ed). New York, NY: Springer. URL
- Wickham H, Grolemund G. 2023. R for data science (2nd ed). Sebastopol, CA: O’Reilly. URL
Diagrams
- Murrell, P. (2018). R Graphics (3rd ed.). Boca Raton, FL: Chapman & Hall/CRC. URL
- Unwin, A. (2015). Graphical data analysis with R. Boca Raton, FL: Chapman & Hall/CRC. URL
- Wickham, H; Sievert C. (2016). ggplot2: Elegant Graphics for Data Analysis. New York, NY: Springer. URL
- Chang, W. (2018).R Graphics Cookbook (2nd ed). Sebastopol, CA: O’Reilly. URL
- Wilke, C. O. (2019). Fundamentals of data visualization. Sebastopol, CA: O’Reilly. URL
Programming with R
- Chambers JM. 2016. Extending R. Boca Raton, FL: Chapman & Hall/CRC.
- Gillespie C, Lovelace R. 2017. Efficient R programming. Sebastopol, CA: O’Reilly. URL
- Wickham H. 2019. Advanced R (2nd ed). Boca Raton, FL: Chapman & Hall/CRC. URL
- Wickham H. 2023. R packages. Sebastopol (2nd ed), CA: O’Reilly. URL
Transition from other statistical software packages
- Muenchen, R. A. (2011). R for SAS and SPSS Users (2nd ed.). New York, NY: Springer. URL
- Muenchen, R. A. & Hilbe, J. M. (2010). R for Stata Users. New York, NY: Springer. URL
Dynamic documents and reproducible research
- Xie Y. 2015. Dynamic documents with R and knitr (2nd ed). Boca Raton, FL: Chapman & Hall/CRC.
- Xie Y, Dervieux C, Riederer E. 2020. R Markdown Cookbook. Boca Raton, FL: Chapman & Hall CRC. URL
- Xie Y, Allaire JJ, Grolemund G. 2018. R markdown: The definitive guide. Boca Raton, FL: Chapman & Hall/CRC. URL
- Gandrud, C. (2020). Reproducible research with R & RStudio (3rd ed). Boca Raton, FL: Chapman & Hall/CRC. URL
- Stodden, V., Leisch, F. & Peng, R. D. (2014). Implementing Reproducible Research. Boca Raton, FL: Chapman & Hall/CRC.
Shiny for interactive Web-Apps
- Sievert C. 2020. Interactive web-based data visualization with R, plotly, and shiny. Boca Raton, FL: Chapman & Hall/CRC. URL
- Wickham H. 2020. Mastering shiny. Sebastopol, CA: O’Reilly. URL
- Harrer M, Cuijpers P, Furukawa T, Ebert D. 2021. Doing Meta-Analysis with R: A Hands-On Guide. Boca Raton, FL: Chapman & Hall/CRC. URL
- Schwarzer G, Carpenter J, Rücker G. 2015. Meta-Analysis with R. New York, NY: Springer. URL
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