Skip to content

Instantly share code, notes, and snippets.

@pratos
Created February 2, 2018 03:12
Show Gist options
  • Save pratos/dc35d3fab61ee1ecb4c209b35bb07cb4 to your computer and use it in GitHub Desktop.
Save pratos/dc35d3fab61ee1ecb4c209b35bb07cb4 to your computer and use it in GitHub Desktop.
require(GGally)
lm.plt <- function(data, mapping, ...){
plt <- ggplot(data = data, mapping = mapping) +
geom_point(shape = 20, alpha = 0.7, color = 'darkseagreen') +
geom_smooth(method=loess, fill="red", color="red") +
geom_smooth(method=lm, fill="blue", color="blue") +
theme_minimal()
return(plt)
}
ggpairs(corr.df, corr.idx[1:6], lower = list(continuous = lm.plt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment