[R] Showing a line function on the ploat area

Jim Lemon jim at bitwrit.com.au
Thu Aug 26 11:25:45 CEST 2010


On 08/26/2010 01:06 AM, Neta wrote:
>
> I have a collection of results. I use R to get the linearization presented.
> how can I get R to show the equation and R^2 value on the plot area next to
> the graph?

Hi Neta,
You can use functions like textbox or boxed.labels (plotrix package) to 
display arbitrary text:


par(mar=c(6,4,4,2))
plot(1:5)
par(xpd=TRUE)
library(plotrix)
boxed.labels(4,0,
  "response~x1+x2\nr-squared = 0.7326",FALSE)
par(xpd=FALSE

Jim



More information about the R-help mailing list