Best regards,
Thierry
library(ggplot2)
#Solution 1: add the reference level to the entire dataset
dat <- expand.grid(Time = 1:50, Mean = c(1000, 4000))
dat$Observe <- round(rnorm(nrow(dat), mean = dat$Mean, sd = 0.01),
digits = 3)
dat$Standard <- factor(dat$Mean, labels = c("Low", "High"))
ggplot(dat, aes(x = Time, y = Observe)) + geom_hline(aes(yintercept =
Mean)) + geom_smooth() + geom_point() + geom_path() + facet_wrap(~
Standard, scales = "free", ncol = 1)
#solution 2: create an extra dataset with the reference level per
standard
Reference <- unique(dat[, c("Mean", "Standard")])
dat$Mean <- NULL
ggplot(dat, aes(x = Time, y = Observe)) + geom_hline(data = Reference,
aes(yintercept = Mean)) + geom_smooth() + geom_point() + geom_path() +
facet_wrap(~ Standard, scales = "free", ncol = 1)
------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry....@inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey
________________________________
--
You received this message because you are subscribed to the
ggplot2 mailing list.
Please provide a reproducible example:
http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in this message
and any annex are purely those of the writer and may not be regarded as stating
an official position of INBO, as long as the message is not confirmed by a duly
signed document.