Skip to content
Prev 285703 / 398502 Next

still need read.zoo command help

On Fri, Feb 17, 2012 at 7:54 PM, Henry <hccoles at lbl.gov> wrote:
The read.zoo statement should come AFTER the library statements, not
before, and the read.zoo should be specified like this where fmt was
also defined in my response to your prior post:

Lines <- "10/11/2011 23:00:06,432.12
10/11/2011 23:02:09,432.42
10/11/2011 23:05:00,432.42"

library(zoo)
library(chron)
fmt <- "%m/%d/%Y %H:%M:%S"
z <- read.zoo(text = Lines, FUN = as.chron, format = fmt, sep = ",")

Also regarding the comment by the other poster, read.zoo reads csv data fine.

Be sure you have read and assimilated ?read.zoo and also
vignette("zoo-read") which is a document entirely devoted to read.zoo
examples.