Thursday, November 21, 2013

Favorite plots in R

Plotting the standard normal distribution:

plot(dnorm, -4, 4, ylab="", xlab="Z", yaxt="n")



 
Plotting a correlation matrix:
cormat <- matrix(runif(100,0,1),nrow=10); diag(cormat) <- 1
rgb.palette <- colorRampPalette(c("red", "green"), space = "rgb")
levelplot(cormat,col.regions=rgb.palette, cuts=199, at=seq(-1,1,0.01))



No comments:

Post a Comment