|
@ -5,19 +5,19 @@ ggcorrplot<-function(df, var, color="#FFFFFF00", stat="signif", tri="all"){ |
|
|
|
|
|
|
|
|
order<- mcor %>% as.data.frame() %>% add_column(Var1=rownames(mcor),.before=1) %>% clustsort |
|
|
order<- mcor %>% as.data.frame() %>% add_column(Var1=rownames(mcor),.before=1) %>% clustsort |
|
|
|
|
|
|
|
|
mor<-mcor[order$y, order$x] |
|
|
|
|
|
|
|
|
mcor<-mcor[order$y, order$x] |
|
|
mpval<-mpval[order$y, order$x] |
|
|
mpval<-mpval[order$y, order$x] |
|
|
|
|
|
|
|
|
df<-mcor %>% as.data.frame() |
|
|
df<-mcor %>% as.data.frame() |
|
|
if (tri == "lower"){ |
|
|
if (tri == "lower"){ |
|
|
df[lower.tri(df, diag=T)]<-NA |
|
|
|
|
|
|
|
|
df[lower.tri(df, diag=F)]<-NA |
|
|
} |
|
|
} |
|
|
df<-df %>% add_column(Var1=rownames(mcor),.before=1) %>% |
|
|
df<-df %>% add_column(Var1=rownames(mcor),.before=1) %>% |
|
|
gather(Var2, Value, -Var1) %>% filter(!is.na(Value)) |
|
|
gather(Var2, Value, -Var1) %>% filter(!is.na(Value)) |
|
|
|
|
|
|
|
|
df.pval<-mpval %>% as.data.frame() |
|
|
df.pval<-mpval %>% as.data.frame() |
|
|
if (tri == "lower"){ |
|
|
if (tri == "lower"){ |
|
|
df.pval[lower.tri(df.pval, diag=T)]<-NA |
|
|
|
|
|
|
|
|
df.pval[lower.tri(df.pval, diag=F)]<-NA |
|
|
} |
|
|
} |
|
|
df.pval<-df.pval %>% add_column(Var1=rownames(mpval),.before=1) %>% |
|
|
df.pval<-df.pval %>% add_column(Var1=rownames(mpval),.before=1) %>% |
|
|
gather(Var2, Value, -Var1) %>% filter(!is.na(Value)) |
|
|
gather(Var2, Value, -Var1) %>% filter(!is.na(Value)) |
|
|