Plot Method for Dates or Times Objects

DESCRIPTION:

Plot numeric data versus dates or times.

USAGE:

plot.times(x, y, ..., xlab = deparse(substitute(x)),  
           ylab = deparse(substitute(y)), 
           type = "p") 

REQUIRED ARGUMENTS:

x
A dates or times object made by the dates or times function to use as the abscissa of the plot.
y
A numeric vector to use as the ordinate of the plot.

OPTIONAL ARGUMENTS:

xlab
The x axis label.
ylab
The y axis label.
type
A character specifying the type of plot, as with the other plot methods. "p" for points, "l" for connect lines, "b" for both, "n" for neither, "h" for high density, "s" and "S" for right and left continuous step functions.
...
All other arguments are passed on to the ts.plot function.

SIDE EFFECTS:

A plot is drawn on the current graphics device.

DETAILS:

Plot.times makes an irregular time series object out of x and y and calls ts.plot with that time series. It sorts them so that x is sorted, hence if x is not originally sorted type="l" will connect points in the sorted order, not in the original order.

SEE ALSO:

, , , , , , .

EXAMPLES:

# The following plots someone's pay vs payday. 
payday <- dates(c("12/15/93", "12/31/93", "1/15/94", "1/31/94", 
                    "2/15/94", "2/28/94"), format = c("m/d/y")) 
pay <- runif(length(payday), 500, 600) 
plot(payday, pay, type = "l") 
# The points are connected by lines and the x axis has tick marks 
# labeled "12/15/93", "12/29/93", ..., "02/23/94" (every 14 days).