Skip to content
Prev 299791 / 398503 Next

Questions about doing analysis based on time

Hmm, I guess that's not exactly what I needed.  It's my fault; you gave me
what I asked for, I was just asking for the wrong thing.

What I'm hoping to do is something similar to:

aggregate(dat$SunScore, by=list(h), median)

except I'd like to do it by half hour instead of hour.  I guess what I need
is a function similar to the hours() function.  I only have rudimentary
programming knowledge, but here's a stab at it, mostly in psuedo-code:

#time is the number I'm looking for, which represents the half hour
0:00-0:29=0, 0:30-0:59=.5, 1:00-1:29=1, 1:30-1:59=1.5, etc
time=0
h<-hours(x)
m<-minutes(x)
if(m<30)
   then time=h
else
   time=h + 0.5

Will this, if programmed correctly, give me an output similar to the hours()
output so that I can use the aggregate() function?

Thanks,
Mike



Rui Barradas wrote
--
View this message in context: http://r.789695.n4.nabble.com/Questions-about-doing-analysis-based-on-time-tp4634230p4636138.html
Sent from the R help mailing list archive at Nabble.com.