r - mfrow retains duplicate plots -


below simple script 6 plots of normal, log normal, negative log normal qq plots respective histograms. using mfrow function, , getting duplicate plots instead of 6 unique plots. appreciate if can direct me solution issue.

y1=rnorm(500,0,1) y2=rlnorm(500,0,1) y3=-rlnorm(500,0,1)  par(mfrow=c(3,2))  plot(qqnorm(y1),xlab="theortical quantiles", ylab="sample quantiles",main="q-q normal") qqline(y1, col='red') plot(hist(y1),main="histogram normal")  plot(qqnorm(y2),xlab="theortical quantiles", ylab="sample quantiles",main="q-q log normal") qqline(y2, col='red') plot(hist(y2),main="histogram log normal")  plot(qqnorm(y3),xlab="theortical quantiles", ylab="sample quantiles",main="q-q negative log normal") qqline(y3, col='red') plot(hist(y3),main="histogram negative log normal") 

you should use qqnorm(y, ...) instead of plot(qnorm(y), ...).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -