## In R: basic

This assumes that you already have `R` installed.

• `?` — basic documentation on a function
``?mean  ?`+```
• `??` — vignettes with title or keyword on a vague topic using regular expressions
``??'regression'``
• `help` — package documentation
``help(package="ggplot2")``

## In R: args

Know the functions but not the arguments? Use tab completion or `args`

``````
> args(lm)
function (formula, data, subset, weights,
na.action, method = "qr", model = TRUE,
x = FALSE, y = FALSE, qr = TRUE,
singular.ok = TRUE, contrasts = NULL,
offset, ...)
NULL
``````

## In R: sos

The `sos` package offers additional searching options to find functions with a specific title or purpose. This is done using either `findFn` or `???`

``````
# if you do not have, uncomment and install
# install.packages("sos")
require(sos)
findFn("lm", maxPages = 2)
# equivalenty
???lm(2)
``````

## In R: sos

Which opens a web browser like this ## In R: example

`example` — run the examples for a function

``````
> example(mean)
mean> x <- c(0:10, 50)

mean> xm <- mean(x)

mean> c(xm, mean(x, trim = 0.10))
 8.75 5.50
``````

`example(mean, local=TRUE)` to not affect your current workspace

## In R: demo

`demo` — to see demonstrations available in a particular package

``````
> demo(package = "stats")
Demos in package 'stats':

glm.vr         Some glm() examples from V&R
with several predictors
lm.glm         Some linear and generalized
linear modelling examples
from `An Introduction to
Statistical Modelling' by
Annette Dobson
nlm            Nonlinear least-squares using
nlm()
smooth         `Visualize' steps in Tukey's
smoothers
``````

## In R: demo

To run a particular demo, use the name and package

``````
> demo("lm.glm", package = "stats")

demo(lm.glm)
---- ~~~~~~

Type  <Return>	 to start :
``````

## In R: vignette

`vignette` — package vignettes are more detailed introductions

``````
> vignette(package = "MCMCglmm")
Vignettes in package 'MCMCglmm':

CourseNotes    MCMCglmm CourseNotes (source,
pdf)
Overview       MCMCglmm Overview (source,
pdf)
``````

Open the course notes as a PDF
`vignette("CourseNotes", package="MCMCglmm")`

## Online: finding the tools

• Task Views — Task Views, showing packages for different fields
• Crantastic — Rates, reviews, and relates packages

/

#