0

I am trying to use the Zoo package to read in daily observations, some of which are not consecutive. The first three lines are:

Date         Year   ID       DWT    Build CargoSize LoadArea DischargeArea Price Speed 
25-May-07    2007 8004351   294739  1982   262000       AG       ECI        79   14.5                
11-Feb-08    2008 8004363   294739  1983   261000       AG       ECI        84   14.5                
11-Feb-08    2008 8003459   294739  1984   265000       WAF      SPOR       89   14.5

I get the following error:

z <- read.zoo("multiplier_test.csv", sep = ";", header = TRUE, format="%d-%b-%y")
Warning message:
In zoo(rval3, ix) :
some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not        unique

The goal is to regress Price on some of these variables, including Date, in which I would like to fit a polynomial to (using a partially linear model with the bs function). The error occurs I believe because there are multiple dates that are the same. This represents a separate transaction; I want to capture the variance between these observations so don't want to aggregate and lose degrees of freedom.

Sassafras
  • 301
  • 5
  • 16
  • 1
    Could you provide a snippet of your `multiplier.csv` file? I imagine the error is something to do with your input. You should always give a Minimal Working Example in order for people to reproduce any errors you are getting. – MattLBeck Dec 17 '12 at 17:04
  • You are correct, when I got rid of some columns the error went away (& don't need them anyway). I've edited the question above. – Sassafras Dec 17 '12 at 19:25

1 Answers1

0

This error occur because you try to convert a string with more than 1000 characters to date.

agstudy
  • 119,832
  • 17
  • 199
  • 261