mark
unread,Dec 2, 2010, 7:29:13 PM12/2/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, msh...@sfbr.org
I am surprised by the legend that I am seeing with qplot and am
wondering if you can explain what is going on and perhaps help me get
the legend that is needed.
I am wanting to use an integer code (admit_code) as the parameter
value for colour in qplot.
admit_code is an integer that can have three values (0, 1, 3). In this
subset of the data, it only has two.
> class(colony_latency$admit_code)
[1] "integer"
> table(colony_latency$admit_code)
1 2
2906 2495
However, the legend that was generated by qplot has 1.0, 1.2, 1.4,
1.6, 1.8, 2.0 as possible values with the four colors of 1.2, 1.4. 1.6
and 1.8 being intermediate between those of 1.0 and 2.0. The points
that are actually plotted are displayed in the two colors
corresponding to 1.0 and 2.0.
The call to qplot is below.
qplot(proc_date[colony_latency$colony == colony],
latency_days[colony_latency$colony == colony],
data = colony_latency, geom = c("point", "smooth"),
color = admit_code, main = str_c(capitalize(colony),
" Colony: Procedure Data Entry Latency\n", start_date_str,
" through ", stop_date_str),
xlab = 'Years', ylab = 'Days Late', span = 0.2)