I am trying to create a bar chart in lattice but the x-axis tick marks are not showing correctly:
dd <- data.frame(Year = 1990:1999, Count = 0:9)
barchart(Count ~ Year, data = dd, horizontal = FALSE)
The tick labels for the x-axis should be 1990, 1991, ... not 1, 2.
I do not want to convert year to a factor before plotting because I need to combine the barchart with an xyplot using c.trellis( ..., x.same = TRUE)
in latticeExtra
, which does not seem to work with factor
axes.
How can I fix this?