things
This commit is contained in:
parent
3b77b4b611
commit
cd76a4b919
1 changed files with 47 additions and 0 deletions
47
scripts/functions/dashboard_ggpairs.R
Normal file
47
scripts/functions/dashboard_ggpairs.R
Normal file
|
@ -0,0 +1,47 @@
|
|||
dashboard_ggpairs=function(
|
||||
plot_df, plot_title
|
||||
, tt_args_size = 2.5
|
||||
, gp_args_size = 2.5
|
||||
){
|
||||
ggpairs(
|
||||
plot_df,
|
||||
columns = 1:(ncol(plot_df)-1),
|
||||
upper = list(
|
||||
continuous = wrap(
|
||||
'cor', # ggally_cor()
|
||||
method = "spearman",
|
||||
use = "pairwise.complete.obs",
|
||||
title="ρ",
|
||||
digits=2,
|
||||
justify_labels = "centre",
|
||||
title_args=list(size=tt_args_size, colour="black"),#2.5
|
||||
group_args=list(size=gp_args_size)#2.5
|
||||
)
|
||||
),
|
||||
lower = list(
|
||||
continuous = wrap("points",
|
||||
alpha = 0.7,
|
||||
size=0.125),
|
||||
combo = wrap("dot",
|
||||
alpha = 0.7,
|
||||
size=0.125)
|
||||
),
|
||||
aes(
|
||||
colour = factor(
|
||||
ifelse(
|
||||
dst_mode==0,
|
||||
"S",
|
||||
"R"
|
||||
)
|
||||
),
|
||||
alpha = 0.5
|
||||
),
|
||||
title=plot_title
|
||||
) +
|
||||
|
||||
scale_colour_manual(values = c("red", "blue")) +
|
||||
scale_fill_manual(values = c("red", "blue")) #+
|
||||
# theme(text = element_text(size=7,
|
||||
# face="bold"))
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue