File: dates.R

package info (click to toggle)
lattice 0.14-13-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,328 kB
  • ctags: 6
  • sloc: ansic: 359; sh: 22; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

postscript("test.ps")
library(lattice)

## POSIXt handling

y <- Sys.time() + 10000 * 1:100
x <- rnorm(100)
b <- gl(3,1,100)

xyplot(y ~ x | b)
xyplot(y ~ x | b, scales = list(relation = "free", rot = 0))
xyplot(y ~ x | b, scales = "sliced")

## Date handling

dat <-
    data.frame(a = 1:10,
               b = seq(as.Date("2003/1/1"), as.Date("2003/1/10"), by="day"))
xyplot(a~b, dat)
xyplot(a~b, dat, scales=list(x=list(at=dat$b)))

dev.off()