[R] average environmental data if AnimalID and Time is duplicated

2012-09-26 Thread Tagmarie
Hello, I tried for about three hours now to solve this problem but I can't figure it out. I am sure someone knows how do it. At least I hope so. I have a data frame somewhat like this: myframe - data.frame (ID=c(Ernie, Ernie, Bert, Bert), Timestamp=c(24.09.2012 09:00, 24.09.2012 09:00,

Re: [R] average environmental data if AnimalID and Time is duplicated

2012-09-26 Thread Jim Lemon
On 09/26/2012 08:53 PM, Tagmarie wrote: Hello, I tried for about three hours now to solve this problem but I can't figure it out. I am sure someone knows how do it. At least I hope so. I have a data frame somewhat like this: myframe- data.frame (ID=c(Ernie, Ernie, Bert, Bert),

Re: [R] average environmental data if AnimalID and Time is duplicated

2012-09-26 Thread Rui Barradas
Hello, Why do you have Hunger and Temp recorded as characters? Between double quotes? myframe - data.frame (ID=c(Ernie, Ernie, Bert, Bert), Timestamp=c(24.09.2012 09:00, 24.09.2012 09:00, 24.09.2012 10:00, 25.09.2012 10:00), Hunger=c(1,5,2,2), Temp=c(25,30,27,28) ) str(myframe)

Re: [R] average environmental data if AnimalID and Time is duplicated

2012-09-26 Thread arun
HI, Just to add to Jim's solution with data.table() myframe- data.frame (ID=c(Ernie, Ernie, Bert, Bert),  Timestamp=c(24.09.2012 09:00, 24.09.2012 09:00, 24.09.2012 10:00,  25.09.2012 10:00), Hunger=c(1,5,2,2), Temp=c(25,30,27,28)  ) library(data.table) myframe1-data.table(myframe)  

Re: [R] average environmental data if AnimalID and Time is duplicated

2012-09-26 Thread Tagmarie
Thank you! Am 26.09.2012 13:31, schrieb Jim Lemon [via R]: On 09/26/2012 08:53 PM, Tagmarie wrote: Hello, I tried for about three hours now to solve this problem but I can't figure it out. I am sure someone knows how do it. At least I hope so. I have a data frame somewhat like this: