r - How can I change the position of the text in a plot -


i add intercept , coeff plot.i tried manually using code:

text(5.0, 150, paste("intercept = 16.12 ", "coef = 0.06", sep = ''), pos = 3) 

but can see picture up.![regression line][1]how can control position better? there way insert intercept , coef plot using the lm results without entering values manually?

having results

x <- rnorm(10) y <- rnorm(10) m <- lm(y~x) 

the coefficients intersept can found:

m$coefficients[1] m$coefficients[2] 

as adding text, should give coordinates text function or maybe use

legend("topleft",...) 

it give nice results.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -