Re: [R] Referencing a vector of data labels in ggplot function

2011-07-11 Thread Ben Hunter
That did it. I just wanted the line names to be placed at the second to last date tick mark. Later I'll write something that adjusts the labels if there isn't room or if there is overlap. Thanks! On Sat, Jul 9, 2011 at 7:38 AM, Hadley Wickham wrote: > Maybe something like this? > > withNames <-

Re: [R] Referencing a vector of data labels in ggplot function

2011-07-09 Thread Hadley Wickham
Maybe something like this? withNames <- function(dframe, lineNames, plotName, colors){ one_day <- subset(dframe, data == '1941-06-16') one_day$lineNames <- lineNames ggplot(dframe, aes(date, value, group = factor, color = factor)) + geom_line(size = 1) + facet_grid(Facet~., scales =