Re: [R] mean of a value of the last 2 hours using plyr (Thank you)

2012-10-26 Thread Tagmarie
ice > California, USA > http://www.fws.gov/redbluff/rbdd_jsmp.aspx > > *From:* Tagmarie > *To:* r-help@r-project.org > *Sent:* Thursday, October 25, 2012 7:35 AM > *Subject:* [R] mean of a value of the last 2 hours > > Hello, > I have a data

Re: [R] mean of a value of the last 2 hours

2012-10-25 Thread Felipe Carrillo
ory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: Tagmarie >To: r-help@r-project.org >Sent: Thursday, October 25, 2012 7:35 AM >Subject: [R] mean of a value of the last 2 hours > >Hello,

Re: [R] mean of a value of the last 2 hours

2012-10-25 Thread S Ellison
> > I want to add an additional column at the right and get in > each row a value which shows the mean of "hunger" of the last two hours. Isn't that just a moving average? if so, see http://stackoverflow.com/questions/743812/calculating-moving-average-in-r, which mentions zoo for RollingMeans,

Re: [R] mean of a value of the last 2 hours

2012-10-25 Thread Rui Barradas
0 1.5 #4 Ernie1 2012-09-24 09:00:00 1.0 #5 Ernie1 2012-09-24 10:00:00 1.0 #6 Ernie1 2012-09-24 11:00:00 1.0 A.K. - Original Message - From: Tagmarie To: r-help@r-project.org Cc: Sent: Thursday, October 25, 2012 10:35 AM Subject: [R] mean of a

Re: [R] mean of a value of the last 2 hours

2012-10-25 Thread arun
org Cc: Sent: Thursday, October 25, 2012 10:35 AM Subject: [R] mean of a value of the last 2 hours Hello, I have a data frame somewhat like that: myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert", "Bert"), Times

[R] mean of a value of the last 2 hours

2012-10-25 Thread Tagmarie
Hello, I have a data frame somewhat like that: myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert", "Bert"), Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00"), Hunger=c(1,1,1,2,2,1) ) myframestime <- as.POSIXct (strptime(as.character(myframe$Timestamp), "%