[R] xyplot type="l"
David Winsemius
dwinsemius at comcast.net
Sun Apr 15 15:37:42 CEST 2012
On Apr 15, 2012, at 6:19 AM, Eiko Fried wrote:
> Probably a stupidly simple question, but I wouldn't know how to
> google it:
>
> xyplot(neuro ~ time | UserID, data=data_sub)
>
> creates a proper plot.
>
> However, if I add
> type = "l"
> the lines do not go first through time1, then time2, then time3 etc
> but in
> about 50% of all subjects the lines go through points seemingly random
> (e.g. from 1 to 4 to 2 to 5 to 3).
> The lines always start at time point 1, though.
>
> Defining "time" as factor or ordered doesn't change this.
> "neuro" is a numerical variable.
>
> It's probably some beginner's mistake, but I don't seem to be able
> to solve
> it.
You should post the results of either str(data_sub) or (preferably)
dput(data_sub). I'm guessing you don't really understand how your data
is stored and that the problem is at the input and preprocessing stage.
--
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list