Plotting Flashcards Preview

R > Plotting > Flashcards

Flashcards in Plotting Deck (35)
Loading flashcards...
1

plot(x)

plot of the values of x (on the y-axis) ordered on the x-axis

2

plot(x, y)

bivariate plot of x (on the x-axis) and y (on the y-axis)

3

hist(x)

histogram of the frequencies of x

4

barplot(x)

histogram of the values of x; use horiz=FALSE for horizontal
bars

5

dotchart(x)

if x is a data frame, plots a Cleveland dot plot (stacked plots
line-by-line and column-by-column)

6

pie(x)

circular pie-chart

7

boxplot(x)

“box-and-whiskers” plot

8

sunflowerplot(x, y)

id. than plot() but the points with similar coor-
dinates are drawn as flowers which petal number represents the num-
ber of points

9

stripplot(x)

plot of the values of x on a line (an alternative to
boxplot() for small sample sizes)

10

coplot(x ̃y | z)

bivariate plot of x and y for each value or interval of
values of z

11

interaction.plot (f1, f2, y)

if f1 and f2 are factors, plots the
means of y (on the y-axis) with respect to the values of f1 (on the x-axis) and of f2 (different curves); the option fun allows to choose the summary statistic of y (by default fun=mean)

12

matplot(x,y)

bivariate plot of the first column of x vs. the first one of y, the second one of x vs. the second one of y, etc.

13

fourfoldplot(x)

visualizes, with quarters of circles, the association be- tween two dichotomous variables for different populations (x must be an array with dim=c(2, 2, k), or a matrix with dim=c(2, 2) if k = 1)

14

assocplot(x)

Cohen–Friendly graph showing the deviations from inde- pendence of rows and columns in a two dimensional contingency ta- ble

15

mosaicplot(x)

‘mosaic’ graph of the residuals from a log-linear regres- sion of a contingency table

16

pairs(x)

if x is a matrix or a data frame, draws all possible bivariate plots between the columns of x

17

plot.ts(x)

if x is an object of class "ts", plot of x with respect to time, x may be multivariate but the series must have the same frequency and dates

18

ts.plot(x)

id. but if x is multivariate the series may have different dates and must have the same frequency

19

qqnorm(x)

quantiles of x with respect to the values expected under a nor- mal law

20

qqplot(x, y)

quantiles of y with respect to the quantiles of x

21

contour(x, y, z)

contour plot (data are interpolated to draw the curves), x and y must be vectors and z must be a matrix so that
dim(z)=c(length(x), length(y)) (x and y may be omitted)

22

filled.contour(x, y, z)

id. but the areas between the contours are
coloured, and a legend of the colours is drawn as well

23

image(x, y, z)

id. but with colours (actual data are plotted)

24

persp(x, y, z)

id. but in perspective (actual data are plotted)

25

stars(x)

if x is a matrix or a data frame, draws a graph with segments or a
star where each row of x is represented by a star and the columns are
the lengths of the segments

26

symbols(x, y, ...)

draws, at the coordinates given by x and y, sym-
bols (circles, squares, rectangles, stars, thermometres or “boxplots”)
which sizes, colours . . . are specified by supplementary arguments

27

termplot(mod.obj)

plot of the (partial) effects of a regression model
(mod.obj)

28

add=FALSE

if TRUE superposes the plot on the previous one (if it exists)

29

axes=TRUE

if FALSE does not draw the axes and the box

30

type="p"

specifies the type of plot, "p": points, "l": lines, "b": points
connected by lines, "o": id. but the lines are over the points, "h": vertical lines, "s": steps, the data are represented by the top of the vertical lines, "S": id. but the data are represented by the bottom of the vertical lines