Puts a symbol (pointer) on a plot at each of the specified locations.
p.tachoPlot(x, y, z, angle=c(pi/4,3*pi/4), size,
method = c("robust", "sensitive", "rank"),
legend = TRUE, show.method = legend,
xlab = deparse(substitute(x)), ylab = deparse(substitute(y)),
xlim, ylim, ...)
coordinates of points. Numeric vectors of the same length.
Missing values (NA
s) are allowed.
numeric vector whose elements give the angles between the horizontal baseline and the minimum and maximum direction of the pointer measured clockwise in radians.
length of the pointers in cm.
string specifying the method to calculate the angle of
the pointer. One of "sensitive"
, "robust"
or
"rank"
. Only the first two characters are necessary.
The minimum and maximum direction of the pointer corresponds to
min(z) and max(z) if method is "sensitive"
or "rank"
and to the upper and lower extreme of z if method is "robust"
(see boxplot
or rrange
for details). The angle is
proportional to z or rank(z) in case of method="rank"
.
logical flag: if TRUE
(default), a legend giving
the values of the minimum and maximum direction of the pointer is drawn.
logical flag, defaulting to legend
; if true,
the method name is printed.
labels for x and y axis; defaults to the ‘expression’ used in the function call.
numeric of length 2, the limits for the x and y axis,
respectively; see plot.default
.
further arguments to plot
. Graphical
parameters (see par
) may also be supplied as arguments
to this function.
A plot is created on the current graphics device.
Christian Keller, June 1995
A scatter plot of the variables x and y is plotted. The value of the third variable z is given by the direction of a pointer (similar to a tachometer). Observations whose z-coordinate is missing are marked by a dot.
data(state)
data(USArrests)
p.tachoPlot(state.center $x, state.center $y, USArrests[,"UrbanPop"])
data(mtcars)
par(mfrow=c(2,2))
## see the difference between the three methods (not much differ. here!)
p.tachoPlot(mtcars$hp, mtcars$disp, mtcars$mpg, method="sens")
p.tachoPlot(mtcars$hp, mtcars$disp, mtcars$mpg, method="rank")
p.tachoPlot(mtcars$hp, mtcars$disp, mtcars$mpg, method="rob")
Run the code above in your browser using DataLab