Re: [R] Max value of each 2 rows in dataframe

2013-02-13 Thread zuzana zajkova
16001 5500519 > #20 ok 2010-01-15 06:19:59 40193.51 64 17016001 5500519 > > #If you need a rolling max, > library(zoo) > rollapply(A$lig,2,max,align="right",fill=NA) > #[1] NA 64 64 44 32 22 13 4 8 8 0 45 64 64 64 64 64 64 51 64 > > > A.K. > > >

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread arun
y(zoo) rollapply(A$lig,2,max,align="right",fill=NA)  #[1] NA 64 64 44 32 22 13  4  8  8  0 45 64 64 64 64 64 64 51 64   A.K. - Original Message - From: zuzana zajkova To: Rui Barradas Cc: r-help@r-project.org Sent: Tuesday, February 12, 2013 6:53 PM Subject: Re: [R] M

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread zuzana zajkova
Hi, sorry for not useable data... When I tried to use the dput function to the dataframe let's call it A, had some problems with the time and clock variables... however I attach an other dataframe B, which is created by merging A with other dataframe. The B dataframe has a little different struct

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread Rui Barradas
Hello, Your data example is a mess. Can't you please use ?dput to post it? Supposing your data is named 'dat', use dput(head(dat, 20)) # Paste the output of this in a post Hope this helps, Rui Barradas Em 12-02-2013 15:30, zuzana zajkova escreveu: Hello, I would like to ask you for help

[R] Max value of each 2 rows in dataframe

2013-02-12 Thread zuzana zajkova
Hello, I would like to ask you for help. I have quite a big dataframe (119 313 rows), this is a part of it: "jul" "ind" "time" "secs" "geo" "act" "lig" "date.x" "clock" "h" "m" "s" "d" "mo" "y" "dtime" "land" "date.y" "sriseIC" "ssetIC" "dssetIC" "dsriseIC" "1207" 14628 5500519 2010-01-19 15:14:5