On 23-Jul-10 09:46:28, Katrin Fleischer wrote:
Dear All,
I fear that this is a really easy question but I do seem to go
around in circles..
I have 2 points on a plot and would like to calculate the slope
of the line drawn through these 2 points.
that cant be so hard?!
Thank you in advance,
Katrin
(y2 - y1)/(x2-x1)
or, if X=c(x1,x2) and Y=c(y1,y2),
diff(Y)/diff(X)
either of which is shorter than
lm(Y ~ X)$coeff[2] ## !! :)
Ted.
E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 23-Jul-10 Time: 12:10:24
-- XFMail --
__
R-help@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.