[R] Trendline for a subset of data

David Winsemius dwinsemius at comcast.net
Fri Oct 9 15:27:43 CEST 2009


On Oct 9, 2009, at 5:50 AM, Steve Murray wrote:

>
> Dear all,
>
> I am using abline(lm ...) to insert a linear trendline through a  
> portion of my data (e.g. dataset[,36:45]). However, I am finding  
> that whilst the trendline is correctly displayed and representative  
> of the data portion I've chosen, the line continues to run beyond  
> this data segment and continues until it intersects the vertical  
> axes at each side of the plot.
>
> How do I display the line so that it only runs between point 36 and  
> 45 (as shown in the example above) as doesn't continue to display a  
> line throughout the rest of the plot space?
>

?segments

> Many thanks,
>
> Steve
> 		 	   		

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list