[R] R not ploting lines in the correct order

Sarah Goslee sarah.goslee at gmail.com
Thu Sep 26 20:23:41 CEST 2013


Hi Shane,

Please use dput() to provide your data, rather than pasting it in so
that we can work from the same R object you are. Please also provide
the code you're using to make the graph.

Sarah

On Thu, Sep 26, 2013 at 1:56 PM, Shane Carey <careyshan at gmail.com> wrote:
> Hi,
>
> I have a set of x, y points where x represents dates and y actual values. I
> am trying to plot a line graph of the data with points on top, but R is
> connecting the wrong points with lines. Does anyone know how I can rectify
> this. Please see sample below:
>
> x=
>  24/09/2009 09:13  16/10/2009 11:17  24/10/2009 21:43  11/09/2009
> 18:34  22/08/2009
> 15:45  10/08/2009 00:30  14/08/2009 14:52  24/09/2009 12:19
> 25/10/2009 12:45  07/11/2009 14:07  17/10/2009 10:51  07/11/2009 15:54
> 01/11/2009 19:21  01/11/2009 12:23  02/10/2009 21:25  30/11/2009 11:40
> 26/10/2009 13:21  23/08/2009 13:28  19/12/2009 10:54  09/08/2009 22:45
>  12/09/2009
> 09:39  11/10/2009 11:28  13/08/2009 16:15  10/09/2009 11:01  21/08/2009
> 10:55  30/11/2009 10:03  26/10/2009 17:08  03/10/2009 12:45
>
> y=
>  4.2537264  4.397792  4.5570224  4.284056  3.9959248  4.2992208  4.2916384
> 4.4053744  4.2992208  4.1399904  4.4053744  4.4432864  4.321968  4.0414192
> 4.5418576  4.321968  4.5949344  4.1475728  4.8679008  4.587352  4.1627376
> 4.132408  4.1551552  4.2537264  4.5191104  4.0717488  4.3750448  4.4053744
> Thanks
> --
> Shane
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list