From cd76a4b91911415166b4521c05054d0a2a247ab5 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Thu, 25 Aug 2022 11:54:40 +0100 Subject: [PATCH] things --- scripts/functions/dashboard_ggpairs.R | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 scripts/functions/dashboard_ggpairs.R diff --git a/scripts/functions/dashboard_ggpairs.R b/scripts/functions/dashboard_ggpairs.R new file mode 100644 index 0000000..88f8444 --- /dev/null +++ b/scripts/functions/dashboard_ggpairs.R @@ -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")) +} +