zoo

using R.zoo to plot multiple series with error bars

I have data that looks like this: > head(data) groupname ob_time dist.mean dist.sd dur.mean dur.sd ct.mean ct.sd 1 rowA 0.3 61.67500 39.76515 43.67500 26.35027 8.666667 11.29226 2 rowA 60.0 45.49167 38.30301 37.58333 27.98207 8.750000 12.46176 3 rowA 120.0 50.22500 ...

R: Date format when writing a zoo object to a file?

Hello I've been playing for a while with zoo package. I can read files using the format="%Y-%m-%d %H:%M" option But how can I use this option when writing the results back to the disk? I mean, the default format seems to be "%m/%d/%Y %H:%M" and I need to be "%Y-%m-%d %H:%M" Where can I change it? cheers ...

R. Zoo. Repeat the first day data through all the day.

Hello I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of the day. That's, The first element everyday is repeated throughout the wole day. This is not same as aggregate(originalseries,as.Date,h...

One hour increment in R, zoo

Hello How can I add one hour to all the elements of the index of a zoo series? I've tried newseries <- myzooseries index(newseries) <- index(myzooseries)+times("1:00:00") but I get the message Incompatible methods ("Ops.dates", "Ops.times") for "+" thanks My index is a chron object with date and time but I've tried w...

R, zoo with performance analytics

hello How can I use a zoo object with the PerformanceAnalytics package? It says that I need a timeseries but I can convert it properly. thanks ...

R, Substitute NAs by zero

Hello How can I substitute NA values by zero in a R zoo series? I've been reading about na.locf and na.omit but I think none of them do what I need. thanks. ...

Use aggregate with a function that uses data from two columns (e.g. cov or prod)

I have a long time series of daily data and 101 columns. Each month I would like to calculate the cov of each of the first 100 columns with the 101st column. This would generate a monthly covariance with the 101st column for each of the 100 columns based on daily data. It seems that aggregate does what I want with functions that take a s...

Read xts from CSV file in R

Hi, I'm trying to read time series from CSV file and save them as xts to be able to process them with quantmod. The problem is that numeric values are not parsed. CSV file: name;amount;datetime test1;3;2010-09-23 19:00:00.057 test2;9;2010-09-23 19:00:00.073 R code: library(xts) ColClasses = c("character", "numeric", "character") Da...