Example code:
library(ggplot2);
result <- c(133.3333, 142.8571, 130.4348, 139.5349, 136.3636, 139.5349, 139.5349, 139.5349,
122.449, 142.8571, 142.8571, 130.4348, 139.5349, 142.8571, 139.5349,
142.8571, 120, 136.3636, 139.5349, 133.3333, 136.3636, 127.6596,
139.5349, 139.5349, 139.5349, 136.3636, 127.6596, 139.5349, 139.5349,
122.449, 136.3636, 139.5349, 136.3636, 130.4348, 139.5349, 136.3636,
127.6596, 136.3636, 127.6596, 130.4348, 122.449, 127.6596, 136.3636,
142.8571, 136.3636, 136.3636, 136.3636, 127.6596);
time <- rep("10mins",48);
df<-data.frame(time, result);
ggplot(df,aes(x=result)) +
geom_histogram(binwidth=10);
ggplot(df,aes(x=result)) +
geom_histogram(binwidth=10) +
facet_grid(~time);
ggplot(unique(df),aes(x=result)) +
geom_histogram(binwidth=10);
The first plot is as expected, with the highest column count >30.
In the second plot I plot this data as part of a facet_grid - the highest count is now only 4. (For simplicity here I only supply data for one facet, the problem is the same with a complete dataset)
The plot is in fact the same as if I plot only the unique values, as in the third plot.
Is this the expected output?
Many thanks,
Freddie
> sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] scales_0.2.0 gridExtra_0.9 ggplot2_0.9.0
loaded via a namespace (and not attached):
[1] colorspace_1.1-1 dichromat_1.2-4 digest_0.5.2 MASS_7.3-17 memoise_0.1
[6] munsell_0.3 plyr_1.7.1 proto_0.3-9.2 RColorBrewer_1.0-5 reshape2_1.2.1
[11] stringr_0.6 tools_2.14.2