[R] Annotate a segmented linear regression plot
harb at student.unimelb.edu.au
Wed Oct 3 00:38:55 CEST 2012
On 28 September 2012 16:38, David Winsemius <dwinsemius at comcast.net> wrote:
> ?text # should be fairly clear.
Thank you. I was stupid to ask such a trivial question along with a
not-so-trivial one. The second part of the question was probably more
important: is there a way to obtain the location of segments produced
by the segmented package, so that I can annotate them easily?
I have since asked this question of Vito, the package's author. Here
is his response:
here a possible solution,
o is the segmented fit
plot(o, col=2:4, res=T)
text(xCoord, yCoord, labels=formatC(slope(o)[][,1], digits=2),
Play with pos, cex and digits to modify the appearance of the labels.
> Please learn to post in plain text.
I hope this is better.
More information about the R-help