[R] Plotting a broken line?

Aldi Kraja aldi at wustl.edu
Wed Mar 7 20:03:19 CET 2007


Hi Greg,

Thank you for your response and a previous posting about Macros in R.

Thank you also to Ken Knoblouch (Ken had the same idea as Greg's and 
Peter Pikal (who proposed the use of segments function).
There is only a technical specific that when applying max function to 
find the limit of y one has to use it with

max(x$indicator, na.rm =TRUE))

It worked!!!
 > x
   Location indicator otherinfo
1       1.2         1       2.2
2       2.5         1       2.5
3       3.7         1       2.3
4       3.7        NA        NA
5      20.1         2       4.3
6      22.5         2       5.2
7      25.0         2       3.4
8      27.3         2       2.2
9      27.3        NA        NA
10     35.1         3       3.4
11     37.0         3       7.2
12     38.0         3       6.1
13     40.1         3       5.4
14     52.9         3       3.3

Aldi

Greg Snow wrote:

>If you insert an NA (or row of NA's) into the data at each place you
>want a break (after indicator increases), then the regular plot with
>type='l' will break the line for you.
>
>Is this what you want?
>
>  
>

--



More information about the R-help mailing list