[R] How to insert gridlines in lattice density plot

Giles gilescrane at verizon.net
Thu Apr 22 22:31:07 CEST 2010


Greetings.

How can I  insert gridlines
in the following density plot call?
Must one compose a panel function?

'data.frame':   46 obs. of  2 variables:
  $ fallrates: num  5.2 7.1 7.1 9.8 3.7 7.5 5 6.2 1.5 2.9 ...
  $ prepost  : Factor w/ 2 levels "post","pre": 2 2 2 2 2 2 2 2 2 2 ...

library(lattice)

   densityplot(~fallrates,  groups = prepost,
      kernal="triangular", lwd=2,
      plot.points = TRUE, ref = TRUE, auto.key = list(columns = 2),
      main="Estimated fall rate density, pre and post intevention")


Thank you for your consideration and comments.
Giles Crane



More information about the R-help mailing list