Displaying 1 result from an estimated 1 matches for "avg_ch_pair".
Did you mean:
avg_ch_pairs
2005 Jul 21
1
Question about 'text' (add lm summary to a plot)
...- (plus minus).
Below is my best attempt (which is franky quite pour). Can anyone
improve on the below?
Specifically,
aligned text and numbers,
aligned decimal places,
symbol for R^2 in the text (expression(R^2) seems to fail with
'paste') and +-
Cheers,
Dan.
dat.lm <- lm(dat$AVG_CH_PAIRS ~ dat$CHAINS)
abline(coef(dat.lm),lty=2,lwd=1.5)
dat.lm.sum <- summary(dat.lm)
dat.lm.sum
attributes(dat.lm.sum)
my.text.1 <-
paste("Slope : ", round(dat.lm.sum$coefficients[2],2),
"+/-", round(dat.lm.sum$coefficients[4],2))
my.text.2 <-...