11 Asking for help
In this lesson we learn about how to ask for help in R. This is probably the most important skill to learn in R.
11.1 Help, Hilfe, Au Secours!
R is very (very!) complete as a statistical language. As such, it has many functions, and many ways to achieve wanted results. For this reason I believe one of the most important aspects of learning R is to know how to find help for your problem. There are several ways you can do this, from inside and outside RStudio and R.
|?function||help about a specific function|
|??function||search the Help System|
|help(“R function”)||primary interface to the help system|
|help.search(“R function”)||search the Help System|
|library(help = “package name”)||opens R documentation|
|apropos(“R function”)||list all functions containing string foo|
|example(“R function”)||show an example of function foo|
|help(datasetname)||open details on a sample dataset|
|vignette(“package name”)||opens Vignette of R package|
|vignette()||show all available vingettes|
|browseVignettes()||list of vignettes from installed packages|
11.2 How to use a given technique in R for the first time
Sometimes you know what you want to do, say, fit a Item Response Theory model to your data, but you do not know how to start. In that case, CRAN Task Views is definately a place to start. It summarize R resources in particular areas of application, helping your to navigate the maze of thousands of R packages. There you find a list with general topics, for example, Psychometrics or Social Sciences, which contains all R packages, their functionality, and a brief explanation. The importance and utility of CRAN Task Views cannot be overestimated, and it is the first place I go in these circumstances.
11.3 Error messages
Sometimes you try to run a function and you receive an error message. If it is not immediatly understandable what the problem is from the message, it can be particularly helpful to paste an error message into a search engine to find out whether others have solved a problem that you encountered. In specific, I find particularly useful to use Google with “R” or “in R” and the name of an R package, function (or both). Say, for example, “How to summarize data per group in R”.
11.4 Asking for Help
If you find that you can’t answer a question or solve a problem yourself, you can ask others for help on the internet. For example, there is a dedicated Chat room for discussion of all things about and related to the R statistical programming language. There you can simply ask questions away. I know I have gotten pretty good answers back in last than 30s.
In case you have a statistical question, or a question that is not purely R-related, there are several other websites in which you can find help.
|Cross Validated||Statistics, data analysis|
|Stack Overflow||Data Science and Machine learning|
|Data Science beta||Data Science and Machine learning|
|Bioconductor.org||Data Science focused on Bioinformatics|
Etiquette 1: In order to ask a question effectively, it helps to phrase the question clearly, and, if you’re trying to solve a problem, to include a small, self-contained, reproducible example of the problem that others can execute. For information on how to ask questions, see the R posting guide, and the document about how to create reproducible examples for R on Stack Overflow.
Etiquette 2: Do not cross-post among any of these venues.
11.5 R Email Lists
The R Project maintains a number of subscription-based email lists for posing and answering questions about R, including the general R-help email list, the R-devel list for R code development, and R-package-devel list for developers of CRAN packages; lists for announcements about R and R packages; and a variety of more specialized lists. Before posing a question on one of these lists, please read the R mailing list instructions and the posting guide. Here’s the link.