[R] Newbie question - handling dates as x-axis variable

Michael Mastroianni mjmalpha at localnet.com
Fri Sep 22 16:44:11 CEST 2000

Hi, all.  Please forgive my ignorance
as I'm just beginning to investigate
R for use in my company as a primary
analytical tool ...

I have data which I've read into a data frame
with the following command:

mkt <- read.csv("h:/qdamrtm.csv",header=T)

I'd like to investigate the relationship(s)
(or lack thereof) between the given variables,
and have developed a variety of plots that
really make me appreciate how powerful
R is, even when applied in a very rudimentary

My question is, is there an elegant way to
treat the date data such that I can plot
variables against x-axis date labels, specify
ranges of dates, and calculate differences
between dates ?  I am beginning to look
at the packages like "chron" and time series
information now.  The workaround I've adopted
merely uses the row index of the data frame
as the x-axis variable, and I've "pasted" the
start and end dates into the x-axis title to
associate the plotted indices with a date
range (which is a bit of a kludge, I think).

If I've gleaned anything at all from the R
documentation, I should be trying to
treat my data frame as an object to be
manipulated, and should be able to
develop functions or procedures which
allow me to handle dates in a simple
and direct manner.

Any advice/guidance/tips are much appreciated
as I have *tons* of this kind of data to
cut my teeth on ...

(Also, kudos to the R developers: what
an incredible job in creating a "numerical
laboratory" environment.  I'm especially
pleased that I can investigate R in a
Windows environment knowing that it's
available as we move to Linux ...)

Thanks in advance for any help --

Mike Mastroianni
For reference, the CSV data looks like this:


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list