Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-28 Thread Bryan Hanson
Hadley, thanks - that was a permutation that I did not try (but should have thought of it). But... Now, when some observations are removed, you get the count on the plot (previously one did not), however, alas, a new problem: the value of .count.. includes the NA's or something similar. Revised

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-28 Thread hadley wickham
Hi Bryan, Thanks for the reproducible example. The problem is actually in your code, not mine ;) You probably want: y = min(res, na.rm = TRUE) - 0.1 * diff(range(res, na.rm = TRUE)) Hadley (drop = TRUE solves a difference problem - it controls whether or not to remove bins with zero count) On

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-23 Thread Bryan Hanson
.. Adding to my original post... OK, here's a little function which demonstrates the behavior I described. Try it with rem = FALSE to see the annotation, then TRUE to see the annotations disappear. What's going on here? Thanks, Bryan res = runif(50, 0, 100) fac = rep(c("A", "B"), 50) df <- data.