[tech-spec] Problem with plotting time series & x-axis labels...

  • From: "Vincent C. Fulco" <vfulco@xxxxxxxxxxxxx>
  • To: tech-spec@xxxxxxxxxxxxx
  • Date: Wed, 26 Jan 2005 13:12:51 -0500

Dear Tech-Specs-

In the next day or so, I will be sending some rudimentary code which should provide a huge guffaw to the R-masters on the list but I humbly hope that it will provide some roadmap for the newest users and maybe facilitate some additional discussion. It is a simple project importing federal reserve data from two e#cel spreadsheets, doing some simple calcs including changing monthly data to quarterly averages and drawing a chart.
#
I have a problem though with the plot function. I've created a vector of results from other source data vectors which plots fine but the x-axis is simply "periods". In an attempt to add some reference dates on the X-axis, I've tried various things including cbind() the date from the original data vector to the calculated vector which are the same length. It prints ok with all the data (i.e. $date, $data) intact when I call the new "cbind()" vector to take a look but I get the following error messages when I attempt to plot().
#
###########################################################################################
surp.defic<- round(dpi.quart-(pce.quart+resfixinv), digits=2)
> #
> plot(surp.defic, type="l", main="Household Surplus (+) or Deficit (-)", sub= "$ Bil. SAAR", xlab="Time", ylab="Values"); abline(h=0); #this plots fine
> ##################################################################################
> surp.defic2<- cbind(priv.res.fixinvest$date, round(dpi.quart-(pce.quart+resfixinv), digits=2))
>
> plot(surp.defic2, type="l", main="Household Surplus (+) or Deficit (-)", sub= "$ Bil. SAAR", xlab="Time", ylab="Values"); abline(h=0); #obviously this is the problem plot
Error in plot.window(xlim, ylim, log, asp, ...) :
need finite xlim values
In addition: Warning messages:
1: NAs introduced by coercion
2: no finite arguments to min; returning Inf
3: no finite arguments to max; returning -Inf
#########################################################################################



* I am hoping the problem is generic enough and so simplistic that I don't have to send all the code until I have cleaned it up. I must be missing something elementary.


Any help would be appreciated.

Vince Fulco


Other related posts: