Programme 2
Programme 2
Lecture 2
Introduction
::::
Help, Demonstration, and Examples in R
Shalabh
Department of Mathematics and Statistics
Indian Institute of Technology Kanpur
1
Starting with R
To start R, double click on the icon .
Then we get the following Gui (Graphic user interface) window
screen
2
Getting Help in R
This can be done in one of the following ways:
3
Getting Help in R
2. Search for help in Google www.google.com
4
5
…continued
6
Getting Help in R
4. Sometimes, you want to search by the subject on which we
want help (e.g. data input). In such a case, type
help.search("data input")
Then we get….
7
Then we get….
8
Getting Help in R
4. 'help()' for on‐line help,
Then we get…. 9
10
Getting Help in R
5) Other useful functions are find and apropos.
For example
> find("lowess") returns
[1] "package:stats"
11
Getting Help in R
7) The apropos returns a character vector giving the names of all
objects in the search list that match your enquiry.
apropos("lm") returns
12
Worked Examples of Functions
To see a worked example just type the function name, e.g., lm
for linear models:
example(lm)
13
…and other details follow further 14
Demonstration of R Functions
This can be useful for seeing the type of things that R can do.
demo(persp) [persp is a command for 3d surface plots]
…and it continues15
Demonstration of R Functions
This can be useful for seeing the type of things that R can do.
demo(graphics)
16