Add a Rug to a Plot

DESCRIPTION:

Add a rug to a plot.

USAGE:

rug(x, ticksize, side=1, lwd) 

REQUIRED ARGUMENTS:

x
a numeric vector

OPTIONAL ARGUMENTS:

ticksize
the length of the ticks; default is 0.03 units
side
the side of the box on which to produce the rugplot
lwd
line-width of the vertical bar; default is 0.01

DETAILS:

a frequency plot of x is added to the appropriate side of the box, represented by a rugof bars. The function jitter is useful for breaking ties.

SEE ALSO:

.

EXAMPLES:

gamob <- gam(Kyphosis ~ s(Age) + s(Number), data=kyphosis, family=binomial)
plot(kyphosis$Age, fitted(gamob)) # plot the fitted values against age 
rug(jitter(kyphosis$Age)) # add a frequency plot of age at the base