Learn R Programming

GGally (version 1.3.2)

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 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

...

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"))
 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