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
Post a Comment