Best,
Ista
> --
> 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
>
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
You need to add a grouping variable to your dataset. Then add group = your_grouping_variable to the aesthetics.
library(ggplot2)
dataset <- data.frame(Day = 1:30, Measure = rnorm(30))
dataset$Connected <- 0
dataset$Connected[9:13] <- 1
dataset$Connected[14:30] <- 2
ggplot(dataset, aes(x = Day, y = Measure, group = Connected)) + geom_line()
HTH,
Thierry
----------------------------------------------------------------------------
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
> -----Oorspronkelijk bericht-----
> Van: ggp...@googlegroups.com
> [mailto:ggp...@googlegroups.com] Namens Alexa
> Verzonden: maandag 27 september 2010 16:48
> Aan: ggplot2
> Onderwerp: Re: Disconnecting Nonconsecutive Points Using Line Graph
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.
The only way I know how to do this is to add in the implicit missings:
library(ggplot2)
library(plyr)
df <- data.frame(day = sample(30, 25), measure = rnorm(25))
all_days <- data.frame(day = seq(min(df$day), max(df$day)))
complete_df <- join(all_days, df)
qplot(day, measure, data = complete_df, geom = "line")
I don't see any way for ggplot2 to work this out automatically - how
could it know that you care about consecutive days instead of hours or
minutes or something else?
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
--