[R] How to use write.csv(x=zoo.object), and how to let the first column corret?

Gabor Grothendieck ggrothendieck at gmail.com
Sat May 2 00:03:11 CEST 2009


Try this:

> library(zoo)
> z <- zoo(cbind(a = 1:4, b = 5:8), Sys.time() + 0:3 * 3600)
>
> z0 <- zoo(coredata(z), format(time(z), "%m-%d-%y %H:%M:%S"))
> write.zoo(z0, sep = ",")
"Index","a","b"
"05-01-09 17:59:31",1,5
"05-01-09 18:59:31",2,6
"05-01-09 19:59:31",3,7
"05-01-09 20:59:31",4,8



On Fri, May 1, 2009 at 5:11 PM, Qianfeng Li <qflichem at yahoo.com> wrote:
> Use  write.csv to output a zoo object, and found the first column in excel like:  (08-10-16 13:12:00)
>
> How to make it look like : 10/16/2008 13:12:00 ?
>
>
> write.csv(x=zoo.object)
>
> Thanks!
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org 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.
>
>




More information about the R-help mailing list