Skip to content

Instantly share code, notes, and snippets.

@gomesfellipe
Created February 20, 2018 03:57
Show Gist options
  • Save gomesfellipe/ec7553ff03d9563bb61182f72e44416b to your computer and use it in GitHub Desktop.
Save gomesfellipe/ec7553ff03d9563bb61182f72e44416b to your computer and use it in GitHub Desktop.
# Funcao para correlacoes
my_fn <- function(data, mapping, method="lm", ...){
p <- ggplot(data = data, mapping = mapping) +
geom_point() +
geom_smooth(method=method, ...)
p
}
data(tips, package = "reshape")
# Uso:
# Correlaçoes cruzadas
ggpairs(tips, lower = list(continuous = my_fn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment