Description Usage Arguments Author(s) Examples
Display the correlation of the given data and
1 2 3 |
data |
data set using |
mapping |
aesthetics being used. Must contain 'x' and 'y'. 'color' will be ignored |
color |
color of main text. Default = "black" |
size |
ggplot2 size of main text. Default = 6 |
palette |
should be a character string that matches a RColorBrewer color palette |
breaks |
can be a vector of breaks points between -1 and 1. If a single numeric number, will set breaks with that many groups |
... |
other arguments being supplied to ggally_text |
use |
|
method |
|
reversePalette |
boolean to determine if the palette should be reversed |
Barret Schloerke schloerke@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | color_cor(iris, ggplot2::aes(x = Sepal.Length, y = Petal.Width))
color_cor(
iris,
ggplot2::aes(x = Sepal.Length, y = -1 * Petal.Width),
method = "spearman"
)
require(GGally)
ggpairs(iris, 1:4, upper = list(continuous = color_cor))
# use kendall correlation, only three color groups and reverse the palette
ggpairs(
iris, 1:3,
lower = "blank",
upper = list(
continuous = wrap(
color_cor,
method = "kendall",
breaks = 3,
reversePalette = TRUE
)
)
)
# use spearman correlation, only three color groups but breaking at abs(0.2)
ggpairs(
iris, 1:3,
lower = "blank",
upper = list(
continuous = wrap(
color_cor,
method = "spearman",
breaks = c(-0.20, 0.20)
)
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.