[R] lattice and dates (correcting e-mail formatting glitch - sorry!!)

Michael A. Miller mmiller3 at iupui.edu
Thu Jun 27 20:46:10 CEST 2002


Hi Nick,

Thanks for the suggestions.  At the suggestion of another reader,
I've settled on using the chron package (from CRAN).  I'll append
an example for those who are interested.

Mike

-- 
Michael A. Miller                               mmiller3 at iupui.edu
  Imaging Sciences, Department of Radiology, IU School of Medicine




df.data <- read.table('df.log')
names(df.data) <- c( 'datestamp', 'timestamp', 'dev', 'size', 
                     'used', 'available', 'percentage', 'path')

library(chron)
library(lattice)

print( df.data$datestamp )
print( df.data$timestamp )

df.data$date <- chron( dates=as.vector(df.data$datestamp), 
                       times=times(df.data$timestamp) )
#df.data$date <- strptime( paste( df.data$datestamp, df.data$timestamp), "%D %X" )
print( df.data$date )

pos <- pretty( as.numeric( df.data$date ) )
lab <- as.character( dates(df.data$date) )
xyplot( used/size ~ as.numeric(date) | path, data=df.data,
        scales = list(x = list(at = pos, labels = lab )))


sample df.log:
06/25/02 13:48:58 node2:/data2          67638296  48221224  15981176  76% /data2
06/26/02 15:59:23 node2:/data2          67638296  52972176  11230224  83% /data2
06/27/02 12:07:45 node2:/data2          67638296  56713248   7489152  89% /data2
06/25/02 13:48:58 node3:/data3          67638296  50150280  14052120  79% /data3
06/26/02 15:59:23 node3:/data3          67638296  54900656   9301736  86% /data3
06/27/02 12:07:45 node3:/data3          67638296  56775680   7426720  89% /data3
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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