[R] Unable to create/index a zoo irregular timeseries

From: vittorio <vdemart1_at_tin.it>
Date: Thu, 21 Feb 2008 17:11:57 +0100


In the text file pressione2008.csv I have the following

"Data","MAX","MIN","Note"
"07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta"
"07-01-2008 18:00:00", 135, 85, ""
"08-01-2008 08:00:00", 125, 75, ""

which is a collection of blood pressure data at different time of the day. I would like to build an its with MIN & MAX blood pressure but being a real newbye with zoo I obtain the following

> library(zoo)

pressione <- data.frame(read.csv("pressione2008.csv"))  

 miedate <- strptime(as.character(pressione[,1]), format="%d-%m-%Y %H:%M:%S")  

> miedate

[1] "2008-01-07 08:00:00" "2008-01-07 18:00:00" "2008-01-08 08:00:00"

> str(miedate)

 POSIXlt[1:9], format: "2008-01-07 08:00:00" "2008-01-07 18:00:00" ...

> ts<- as.zoo(matrix(pressione[,2:3],ncol=2), miedate)
> ts

Error in Ops.POSIXt(freq, d) : * not defined for "POSIXt" objects

> ts<- zoo(matrix(pressione[,2:3],ncol=2), miedate)
Error in order(x, ..., na.last = na.last, decreasing = decreasing) :   unimplemented type 'list' in 'orderVector1' In addition: Warning message:
In zoo(matrix(pressione[, 2:3], ncol = 2), miedate) :   some methods for "zoo" objects do not work if the index entries in 'order.by' are not unique

>

Please help

Ciao
Vittorio



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. Received on Thu 21 Feb 2008 - 16:27:34 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 21 Feb 2008 - 17:30:16 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.

list of date sections of archive