Viewing Basic Graphics with R

R offers a remarkable variety of graphics. It has excellent graphics and plotting capabilities, which can mostly be found in 3 main sources: base graphics, the lattice package, the ggplot2 package.

Working with base graphics:

Step 1: To get an idea of different kinds of graphs that can be created, you can type demo(graphics) in the console.

dg1

Step 2: It leads you to a prompt called ‘Type <Return> to start :’ .

Type return.

 

dg2

Step 3: It will ask you to ‘Hit <Return> to see next plot :’.

Type return.

dg3

Step 4: It keeps on asking you to type return until it finds a ‘>’ prompt.

Simultaneously, it shows the following graphs every time you press return with a description in the console for the graph that is being created.

1. Here it shows a color wheel to have a relationship among the variables.

dg4

2. A pie chart to have a clear view of variables in ratios.

dg5

3. A Boxplot that graphically depicts group of numerical variables through their quartiles.

dg6

4. Below it shows a brownian or random motion of variables with respect to Time and Distance.

dg7

5. A line graph showing variations with time.

dg8

6. A histogram to see the change in variables among one or more variables.

dg9

7. A scatter plot showing change in variables in different ranges.

dg10

8. Scatter plot with the ranges showing variation in colors.

dg11

9. A topographic map categorized by a large scale of data.

dg12

10. Below it has used the par function to set or query graphical parameters. Here you can stop pressing return because you have encountered the ‘>’ prompt.

topo

Viewing 3D graphs:

Step 1: Similarly, to have an idea about the 3D visualizations, type in demo(persp) in the console and press return(enter) when the prompt says ‘Type <Return> to start :’.

l23

Step 2: It will ask you to ‘Hit <Return> to see next plot :’. Type return.

l24

l25

l26

l27

l28

l29

l30

l31

Stop pressing return when you encounter the ‘>’ prompt.

Leave A Reply

Your email address will not be published. Required fields are marked *