The The R Primer logo Primer

Getting help

You have run into a problem and are looking for help about a function or specific topic.

Solution: The help function returns documentation about a function or data frame.

The apropos function lists command names that contain a specific search pattern.

RSiteSearch performs a search of the help pages, the R-help mailing list archives and available vignettes.

Examples are shown below (not all output shown):

> help(mean)      # Get help about the function mean 
> help("mean")    # Same as above
> ?mean           # Same as above
> apropos("mean")
 [1] "colMeans"        "kmeans"          "mean"        
 [4] "mean.data.frame" "mean.Date"       "mean.default"
 [7] "mean.difftime"   "mean.POSIXct"    "mean.POSIXlt"
[10] "rowMeans"        "weighted.mean"  
> help.search("mean")
Help files with alias or concept or title matching
`mean' using regular expression matching:

gplots::bandplot   Plot x-y Points with Locally Smoothed
                   Mean and Standard Deviation
gplots::plotmeans
                   Plot Group Means and Confidence
                   Intervals
> RSiteSearch("sas2r")  # Search for the string sas2r in online 
>                       # help manuals and archived mailing lists

See rule 5.1 in The R Primer for more information

Back to tips.