GGally (version 1.2.0)

ggally_cor: Correlation from the Scatter Plot

Description

Estimate correlation from the given data.

Usage

ggally_cor(data, mapping, alignPercent = 0.6, method = "pearson", use = "complete.obs", corAlignPercent = NULL, corMethod = NULL, corUse = NULL, ...)

Arguments

data
data set using
mapping
aesthetics being used
alignPercent
right align position of numbers. Default is 60 percent across the horizontal
method
method suppied to cor function
use
use supplied to cor function
corAlignPercent
deprecated. Use parameter alignPercent
corMethod
deprecated. Use parameter method
corUse
deprecated. Use parameter use
...
other arguments being supplied to geom_text

Examples

Run this code
 data(tips, package = "reshape")
 ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
 ggally_cor(
   tips,
   mapping = ggplot2::aes(x = total_bill, y = tip),
   size = 15,
   colour = I("red")
 )
 ggally_cor(
   tips,
   mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"),
   size = 5
 )

Run the code above in your browser using DataLab