Re: [R] time

About this list Date view Thread view Subject view Author view Attachment view

From: Wolski (wolski@molgen.mpg.de)
Date: Thu 27 May 2004 - 06:52:48 EST


Message-id: <200405262252480005.0039244C@mail.math.fu-berlin.de>

Hi!
I would extract the minutes from the time using sub (see ?sub) or (?grep)
than use them as factors (?as.factors)
and finally
?tapply

eg.
tt<-1:10
 fac<-c(rep(0,4),rep(1,6)) # here put the minutes from the time
fac
 [1] 0 0 0 0 1 1 1 1 1 1
fac<-as.factor(fac)
fac
 [1] 0 0 0 0 1 1 1 1 1 1
Levels: 0 1

tapply(t,fac,max)
 0 1
 4 10

Sincerely Eryk.

*********** REPLY SEPARATOR ***********

On 5/26/2004 at 3:00 PM solares@unsl.edu.ar wrote:

>Hi, i need select data from data frame, for example:
>x is a data frame with values in jump to 5 seconds
>12:10:00 51 //one minute
>12:10:05 63
>12:10:10 75
>12:10:15 88
>..
>12:10:59 45
>12:11:00 46 //another minute
>12:11:05 11
>..
>Have a command what to select the data minute to minute, for example
>in the example above i need the maximun values minute to minute
>1 minute-->88
>2 minute--> 46
>Thanks Ruben
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Dipl. bio-chem. Eryk Witold Wolski @ MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin 'v'
tel: 0049-30-83875219 / \
mail: wolski@molgen.mpg.de ---W-W---- http://www.molgen.mpg.de/~wolski

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:13 EST