[R] Assigning "dates" attribute

From: JTW <jack_wang2000_at_yahoo.com>
Date: Fri 08 Apr 2005 - 01:26:41 EST


Dear List,

I have a one-column data set in .csv format.

I used read.csv to import the data into R, as follows:

x <- read.csv("data.csv", header = TRUE, sep = ",")

The data points have a 'dates' attribute, which is in a separatel .csv file. I used the same command as above to import it into R.

To assoicate the 'dates' attribute with the data points, I did:

> attributes(x)<-date

Which resulted in:

Error in "attributes<-"(`*tmp*`, value = date) : attributes must be in a list

So then I did:

> attributes(x)<-list(date)

Again, got an error, though slightly different this time:

Error in "attributes<-"(`*tmp*`, value = list(date)) : attributes must be named

Any help is appreciated.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 08 01:33:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:03 EST