Getting help

If you're starting with R you will regularly encounter Errors, Warnings, Messages and other problems. No one can do programming without errors. This section explains how you can get help through the R documentation.

R (and every package) comes with a comprehensive set of help files. Every function needs to have an accompanying help file. Unfortunately, these help-files are not always easy to read.

You can access the help for every function by preceding it with a ?:

?mean

or by using the search field in the help pane. This will open this file:

alt text

These help files always have the same structure (some parts can be missing):

  • Description: A short description what the function does.

  • Usage: Here you see all the function arguments (i.e. the information you need to give to the function).

  • Arguments: A detailed description of the function arguments.

  • Details: Usually, mathematical details about the implementation.

  • Value: A description of what the function returns.

  • Author(s): Who wrote the function. If you have a question or find a bug you may contact the author.

  • References: More information about the methods and how to cite them.

  • See Also: Links to other related functions.

  • Examples: This is perhaps the most useful part for a beginner. Here you find examples how the function is used. Copy them into the console and inspect the objects that are passed, what arguments are used and what the output is.

Unlock full access  unlock