0% found this document useful (0 votes)
17 views16 pages

Programme 2

R provides several ways to get help and examples for its functions: 1. Click the help button or type ?functionName to get help for a specific function. 2. Use help.search("topic") or help.start() to search the documentation by topic. 3. Type example(functionName) to see example usage and output of a function. 4. The demo() function demonstrates the functionality of various graphics and modeling functions.

Uploaded by

kavithanjali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views16 pages

Programme 2

R provides several ways to get help and examples for its functions: 1. Click the help button or type ?functionName to get help for a specific function. 2. Use help.search("topic") or help.start() to search the documentation by topic. 3. Type example(functionName) to see example usage and output of a function. 4. The demo() function demonstrates the functionality of various graphics and modeling functions.

Uploaded by

kavithanjali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Foundations of R Software

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:

1) Start R software and click the help button in the toolbar of


the R Gui (Graphic user interface) window.

3
Getting Help in R
2. Search for help in Google www.google.com

3. If you need help with a function, then type question mark


followed by the name of the function. For example,
?read.table to get help for function read.table.

4
5
…continued

All minor details and explanations of all arguments are given.

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….

Clicking over the link give required information

8
Getting Help in R
4. 'help()' for on‐line help,

or 'help.start()’ for an HTML browser interface to help.

Then we get…. 9
10
Getting Help in R
5) Other useful functions are find and apropos.

6) The find function tells us what package something is in.

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)

and we see the printed and graphical output produced by the lm


function.

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

You might also like