GGally (version 1.5.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,
  displayGrid = TRUE,
  ...
)

Arguments

data

data set using

mapping

aesthetics being used

alignPercent

right align position of numbers. Default is 60 percent across the horizontal

method

method supplied to cor function

use

use supplied to cor function

corAlignPercent

deprecated. Use parameter alignPercent

corMethod

deprecated. Use parameter method

corUse

deprecated. Use parameter use

displayGrid

if TRUE, display aligned panel gridlines

...

other arguments being supplied to geom_text

Examples

Run this code
# NOT RUN {
 data(tips, package = "reshape")
 ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
 # display with no grid
 ggally_cor(
   tips,
   mapping = ggplot2::aes_string(x = "total_bill", y = "tip"),
   displayGrid = FALSE
 )
 # change text attributes
 ggally_cor(
   tips,
   mapping = ggplot2::aes(x = total_bill, y = tip),
   size = 15,
   colour = I("red")
 )
 # split by a variable
 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