Displaying 1 result from an estimated 1 matches for "lm_eqn".
2013 Jan 21
1
Very slow in processing the equation in the scatter plot ggplot
...ot;,header=TRUE,sep=",")
library(ggplot2)
p <-
ggplot(mydata,aes(date))+geom_line(aes(y=modeled,colour="modeled"))+geom_line(aes(y=observed,colour="observed"))
p
p1 <- ggplot(mydata, aes(modeled,observed))+geom_point(aes(y=observed))
#p1 <- p1+stat_smooth()
lm_eqn = function(mydata){
m = lm(modeled ~ observed, mydata);
eq <- substitute(italic(y) == a + b %.%
italic(x)*","~~italic(r)^2~"="~r2,
list(a = format(coef(m)[1], digits = 2),
b = format(coef(m)[2], digits = 2),...