[R] Time Plot Question.
John Jaynes
fatman at oregonsbest.com
Sat Jul 26 18:18:33 CEST 2003
Hello,
I have some data (sar -A -f sar_data.file > mydata) that span 24 hours, more or less, 00:00:00 - 23:59:59, or so.
I would like to retain and plot data for all 24 x 60 x 60 = 86,400 seconds. I am able to set the x coordinates equal
to ISOdate( year, month, day, hour, minute, second) calls. However, ISOdate calls such as
"ISOdate(2003, 7, 13, 7, 0:59, 0:59)"
do not return all the seconds contained in hour 7. These function calls works:
R> x <- ISOdate(2003, 7, 13, 7)
R> for(j in 0:59) for(i in 0:59) x <- c(x, ISOdate(2003, 7, 13, 7, j, i )),
assigning all the seconds contained in hour 7, to x.
When I attempt this
for(k in 7:23) for(j in 0:59) for(i in 0:59) x <- c(x, ISOdate(2003, 7, 13, k, j, i )),
my computer hangs, as, I am guessing, this call requires too much memory of some sort. I could break up these
data and plot 1 Hour blocks, but would like to also view this data in a 24 Hour plot. The raw data appears as:
Time user nice system idle
08:42:07 79.00 0.00 21.00 0.00
08:42:08 87.00 0.00 13.00 0.00
08:42:11 92.24 0.00 7.76 0.00
08:42:13 41.09 0.00 3.27 55.64
08:42:15 95.67 0.00 4.33 0.00
08:42:16 98.00 0.00 2.00 0.00
...
Is there an easier way to do this? I have read the help pages, but have not found one that is applicable. Any help
would be greatly appreciated. Thanks for making this Very useful program freely available.
John
More information about the R-help
mailing list