Skip to content

Instantly share code, notes, and snippets.

@epijim
Last active December 22, 2015 17:39
Show Gist options
  • Save epijim/6507625 to your computer and use it in GitHub Desktop.
Save epijim/6507625 to your computer and use it in GitHub Desktop.
The corrgram package in R can produce a scattergraph in the lower diamond, with smoothed lines and confidence ellipse in the upper diamond. Great for visualising correlations in the dataset.
library(corrgram)
# Create correlagram of scatter against lines with conficence
# lines are loess smoothed curve
# eclipse is bivariate 68% concentration ellipse (68% of data inside!)
corrgram(Dataframe[,VECTORofCOLUMNSofINTEREST], order=FALSE, lower.panel=panel.pts,
upper.panel=panel.ellipse, text.panel=panel.txt,
diag.panel=panel.minmax,
main="Correlations between variables within the vector VECTORofCOLUMNSofINTEREST")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment