Richard Nixon
unread,Aug 6, 2010, 5:33:08 PM8/6/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Hi,
Looks like the problem was that I was not using the latest version of
ggplot2. The plot behaves as expected under version 0.8.8, and needs
the data set below (data in the original post does not work with
0.8.8).
p <- ggplot(demo.data, aes(x = DATE, y = LINE.TYPE)) +
geom_line() +
geom_point(aes(shape = POINT.TYPE))
p + facet_wrap(~ ID)
demo.data <- structure(list(ID = structure(c(3L, 3L, 4L, 4L, 4L, 4L,
6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 1L, 1L, 1L, 1L, 5L, 5L, 8L, 8L, 2L, 2L,
2L, 2L, 7L, 7L, 7L, 7L), .Label = c("0324", "1734", "1790", "6541",
"6717", "6759", "7646", "9898"), class = "factor"), DATE =
structure(c(11565,
11865, 10920, 11220, 10920, 11220, 12005, 13207, 13298, 13598,
12430, 12730, 12005, 13207, 13075, 13375, 13075, 13375, 11955,
12255, 14469, 14769, 14609, 14909, 14609, 14909, 13843, 14143,
13843, 14143), class = "Date"), POINT.TYPE = structure(c(3L,
3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 2L, 2L, 3L, 4L, 3L, 3L, 3L,
3L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L), .Label = c("1",
"2", "3", "4"), class = "factor"), LINE.TYPE = structure(c(4L,
4L, 2L, 2L, 4L, 4L, 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 1L, 1L, 4L,
4L, 2L, 2L, 2L, 2L, 1L, 1L, 4L, 4L, 1L, 1L, 4L, 4L), .Label = c("D",
"C", "B", "A"), class = "factor")), .Names = c("ID", "DATE",
"POINT.TYPE", "LINE.TYPE"), row.names = c(NA, 30L), class =
"data.frame")