Skip to content

Posix data in Lattice

2 messages · Shawn Way, Deepayan Sarkar

#
I have a number of plots that I'm trying to do using the lattice package,
unfortunately, they involve Posix values.

A small sample of the data is as follows:

                   Time   TC.1  <Snipped>
1   2003-04-24 13:29:15  26.61
2   2003-04-24 13:29:30  26.48
3   2003-04-24 13:30:00  26.53
4   2003-04-24 13:30:30  27.85
<Snipped>

where

str(data)
`data.frame':	415 obs. of  22 variables:
 $ Time :`POSIXlt', format: chr  "2003-04-24 13:29:15" "2003-04-24 13:29:30"
"2003-04-24 13:30:00" "2003-04-24 13:30:30" ...
 $ TC.1 : num   26.6  26.5  26.5  27.9 100.0 ...
<Snipped>

What I'm trying to do is plot TC.1 vs Time (which I can do easily), but I
need the xaxis to represent the Time instead of a numeric such as
105121000,etc.

I also need to rotate the times, but I think I have that figured out...

Any thoughts?


Shawn Way
Engineering Manager
Tanox, Inc.
#
On Friday 25 April 2003 08:21 am, Shawn Way wrote:
Try converting Time to POSIXct and use it normally in a lattice call (maybe 
lattice should do the conversion itself). This should display the times 
properly, however, the formatting definitely needs some improvement.

Let me know if this doesn't solve your problem.

Deepayan