Re: [R] Help with finding mean at 1 second interval

2014-03-19 Thread arun
Hi Satish, Pascal's suggestion is better. Please use ?dput() to show the example data.  op <- options(digits.secs=6) library(zoo) ##added a couple more rows  dat <- read.zoo(text="V1 V2 V3 V4 V5 V6 '2014-03-14 22:41:46.988804'  10   2   8   3  14 '2014-03-14 22:41:46.991126'  13   4   9   5  15

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread arun
Hi, You could also try: library(plyr) ddply(mutate(sardat,sec=as.numeric(gsub(".*:(.*)\\..*$","\\1",sardat$V1))),.(sec), numcolwise(mean)) #  sec   V2   V3    V4   V5   V6 #1  46 15.0 3.80 11.20 4.60 17.8 #2  47 14.28571 4.428571  9.857143 3.428571 16.85714

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread Pascal Oettli
Hello, Please have a look at the "xts" package. Please don't post in HTML. Regards, Pascal On Wed, Mar 19, 2014 at 12:26 AM, Satish Anupindi Rao wrote: > Hi, > I have a zoo object with the first column as index. The columns have not been > named yet... but that I can change. It looks like thi

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread Jim Lemon
On 03/19/2014 02:26 AM, Satish Anupindi Rao wrote: Hi, ... I would like to find the mean of the V2 to V6 columns on a per second interval. Would anyone please be able to help me with a function and implementation for that please? Hi Satish, If you don't care about the location of the interva

[R] Help with finding mean at 1 second interval

2014-03-18 Thread Satish Anupindi Rao
Hi, I have a zoo object with the first column as index. The columns have not been named yet... but that I can change. It looks like this : V2 V3 V4 V5 V6 2014-03-14 22:41:46.988804 10 2 8 3 14 2014-03-14 22:41:46.991126 13 4 9