corr_plot | R Documentation |
Function for making a correlation plot starting from a formula and a data.frame
corr_plot(x, ...)
## S3 method for class 'formula'
corr_plot(x, data, cex.labels = NULL, ...)
## S3 method for class 'data.frame'
corr_plot(
x,
...,
jitter = FALSE,
smooth = FALSE,
lines = TRUE,
pch = 20,
digits = 2,
cex.cor = NULL,
cex.labels = NULL,
method = "pearson",
stars = FALSE,
resize = FALSE,
hist = TRUE,
col.bar = "RoyalBlue",
col.bar.border = "lightblue",
col.line = "blue",
col.smooth = col.line,
main = "",
sub,
xlab,
ylab
)
corr_pairs(
data,
jitter = FALSE,
smooth = FALSE,
lines = TRUE,
pch = 20,
digits = 2,
cex.cor = NULL,
cex.labels = NULL,
method = "pearson",
stars = FALSE,
resize = FALSE,
hist = TRUE,
col.bar = "RoyalBlue",
col.bar.border = "lightblue",
col.line = "blue",
col.smooth = col.line,
...
)
corr_plot2(
...,
main = "",
type = "pearson",
sig.level = NULL,
r.level = 0.1,
mar = c(1, 1, 1, 1),
include.order = FALSE,
method = "color",
col = RColorBrewer::brewer.pal(100, "RdBu")
)
x |
formula oder data.frame |
... |
an prepare_data2 |
data |
a data matrix |
jitter |
Rauschen |
smooth , lines |
Anpassungslienien |
lines |
Regressinsgerade |
pch |
Symbole pch=20 |
digits , method |
correlation |
cex.cor , resize |
Fixe groese mit cex.cor, resize abhaengig von r-Wert |
method |
c("circle", "square", "ellipse", "number", "shade", "color", "pie"), |
stars , resize , cex.cor |
correlation formatierung |
hist |
Histogram TRUE/FLASE |
col.bar , col.bar.border , col.line , col.smooth |
Farben |
main |
titel |
type |
c("full", "lower", "upper"), |
sig.level |
signifikanz |
col |
RColorBrewer::brewer.pal(100, 'RdBu') |
smooth |
Gezeichnete Lineie |
digits |
Nachkommastellen in plot |
stars |
Sternchen |
order |
c("original", "AOE", "FPC", "hclust", "alphabet"), |
diag |
FALSE, |
nix
#'
# require(stp25plot)
# require(stp25tools)
require(tidyverse)
n <- 500
set.seed(1)
dat<-
data.frame(
a = rnorm(n)) |>
mutate(
b = a + rnorm(n),
c = b / 2 + rnorm(n),
d = c / 3 + rnorm(n),
e = 2 - a + rnorm(n),
f = e / 5 + rnorm(n)
)
# cor(dat)
# cor_matrix <- Hmisc::rcorr(dat)
corr_plot( ~ a + e + f+ b + c + d,
dat,
resize=FALSE)
corr_plot2(dat)
#par(mfrow= c(1,2))
corr_plot2(dat, main = "patient", sig.level = .2)
corr_plot2(dat, main = "patient",
r.level = .2,
type="spearman",
order = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.