The Art of R Programming

(WallPaper) #1
Imagine how useful this can be for graphics! If you are interested in see-
ing what one of R’s excellent graphics functions does, theexample()function
will give you a “graphic” illustration.
To see a quick and very nice example, try running the following
command:

> example(persp)

This displays a series of sample graphs for thepersp()function. One
of these is shown in Figure 1-2. PressENTERin the R console when you are
ready to go to the next one. Note that the code for each example is shown
in the console, so you can experiment by tweaking the arguments.

Figure 1-2: One of thepersp()examples

1.7.3 If You Don’t Know Quite What You’re Looking For.................


You can use the functionhelp.search()to do a Google-style search through
R’s documentation. For instance, say you need a function to generate ran-
dom variates from multivariate normal distributions. To determine which
function, if any, does this, you could try something like this:

> help.search("multivariate normal")

22 Chapter 1

Free download pdf