[R] A question about POSIXct

From: Jacques Smith <jacques.wagnor_at_gmail.com>
Date: Thu, 03 May 2007 14:56:40 -0500


Dear List:

I have a simple two-column data set in .csv format, with the first column being the date and second column being some value. I use read.csv() to import the data as follows:

x <- read.csv("myfile.csv",header=T, dec=".", colClasses=c(Date="POSIXct"))

The structure of x is:

> str(x)

`data.frame': 2959 obs. of 2 variables:

 $ Date:'POSIXct', format: chr "1998-01-01" "1998-01-01" "1998-01-01" "1998-01-01" ...

 $ Value: num 0.07379 0.07181 0.01555 0.00630 0.00688 ...

This is not what I want. Instead, I want the structure to be the same as that of the following data set:

> str(danish)

 atomic [1:2167] 1.68 2.09 1.73 1.78 4.61 ...

"danish" is a data set that the package "evir" comes with.

Any help would be appreciated.

        [[alternative HTML version deleted]]



R-help_at_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 and provide commented, minimal, self-contained, reproducible code. Received on Thu 03 May 2007 - 20:58:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 May 2007 - 21:32:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.