[R] chron printing and plotting
Strumila, John
John.Strumila at team.telstra.com
Thu Jul 13 04:33:25 CEST 2000
g'day R guru's.
Could someone help me out with 2 'chron' questions please (I've been using
the 'date' package but I need time handling)? The doco doesn't cover
everything and I'm too green to understand all the code.
When my chron object is printed using 'print' the output is not in the
format requested by the default attributes. What am I doing wrong?
> attributes(my.date)
$format
[1] "d/m/y" "h:m:s"
$origin
month day year
1 1 1970
$class
[1] "chron" "dates" "times"
> print(times(my.date))
Time in days:
[1] 11138.92 11138.92 11138.92 11138.92 11138.92 11138.92 11138.92
11138.92
[9] 11138.92 11138.92 11138.92 11138.92 11138.92 11138.92 11138.92
11138.92
Also, I want my plot's x-axis to show the time only - without the date part.
If I plot the chron object then times aren't shown, but if I use plot on the
time object only, the x-axis is sorted incorrectly.
> times(c("22:00:00","23:00:00","0:00:00"))
[1] 22:00:00 23:00:00 00:00:00
> plot(times(c("22:00:00","23:00:00","0:00:00")))
thanks,
John Strumila
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list