[R] Plot 1:1 relationship

Sarah Goslee sarah.goslee at gmail.com
Fri Jan 28 18:52:55 CET 2011


abline() takes the intercept and slope, which for a 1:1 relationship
are 0 and 1, respectively.
So:
abline(0, 1)

Sarah

On Fri, Jan 28, 2011 at 10:42 AM, Peter Francis <peterfrancis at me.com> wrote:
> Dear list,
>
> I am looking to plot a line on a graph to show the 1:1 relationship, in order to demonstrate the pattern i have observed is off the line, however i am unsure. I have tried abline but i can not see a function to plot the 1:1?
>
>
> Any help would be greatly appreciated
>
> #generate data
> y <- rnorm(30, mean=1.5, sd= 0.005)
> x <- rnorm(30, mean=1.5, sd= 0.005)
> plot(x,y)
>
> Thanks,
>
> Peter
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list