R/corrPlot.R

Defines functions corrPlot

Documented in corrPlot

corrPlot <-
function(x, y, data,...){
	xx=data[,x]
	yy=data[,y]
	plot(yy~xx,bty="n",mgp=c(2.3,1,0),xlab=x,ylab=y,...)
	abline(lm(yy~xx),col="red")
	cor=cor.test(xx,yy) 
	mtext(side=3,paste("r =",round(cor$estimate,2),", p =",signif(cor$p.value,2)))
}

Try the KOGMWU package in your browser

Any scripts or data that you put into this service are public.

KOGMWU documentation built on May 2, 2019, 4 p.m.