# NOT RUN {
# ==============================================
# Correlation Test
# ==============================================
if (require("see")) {
rez <- cor_test(mtcars, "mpg", "wt")
layers <- visualisation_recipe(rez, labs = list(x = "Miles per Gallon (mpg)"))
layers
plot(layers)
plot(rez,
show_text = "label",
point = list(color = "#f44336"),
text = list(fontface = "bold"),
show_statistic = FALSE, show_ci = FALSE, stars = TRUE
)
}
# }
# NOT RUN {
# ==============================================
# Correlation Matrix
# ==============================================
if (require("see")) {
rez <- correlation(mtcars)
x <- cor_sort(as.matrix(rez))
layers <- visualisation_recipe(x)
layers
plot(layers)
#' Get more details using `summary()`
x <- summary(rez, redundant = TRUE, digits = 3)
plot(visualisation_recipe(x))
# Customize
x <- summary(rez)
layers <- visualisation_recipe(x,
show_data = "points",
scale = list(range = c(10, 20)),
scale_fill = list(
high = "#FF5722",
low = "#673AB7",
name = "r"
),
text = list(color = "white"),
labs = list(title = "My Plot")
)
plot(layers) + theme_modern()
}
# }
# NOT RUN {
if (FALSE) {
# ==============================================
# Correlation Results (easycorrelation)
# ==============================================
if (require("see") && require("tidygraph") && require("ggraph")) {
rez <- correlation(iris)
layers <- visualisation_recipe(rez)
layers
plot(layers)
}
}
# }
Run the code above in your browser using DataLab