Browse Source

Corregido la selección de color en ggcorrplot.

main
Costa 2 years ago
parent
commit
81e3902250
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      R/ggcorrplot.R

+ 2
- 2
R/ggcorrplot.R

@ -1,4 +1,4 @@
ggcorrplot<-function(df, var){
ggcorrplot<-function(df, var, color="#FFFFFF00"){
m.df<-df %>% spread(Cyt, Value) %>% select(-pats) m.df<-df %>% spread(Cyt, Value) %>% select(-pats)
mcor<-cor(m.df, m.df, use="pairwise.complete.obs") # Por defecto usa el método de Pearson. mcor<-cor(m.df, m.df, use="pairwise.complete.obs") # Por defecto usa el método de Pearson.
mpval<-Hmisc::rcorr(as.matrix(m.df))$P mpval<-Hmisc::rcorr(as.matrix(m.df))$P
@ -13,6 +13,6 @@ ggcorrplot<-function(df, var){
ggplot(df, aes(Var1, Var2, fill=Value))+ ggplot(df, aes(Var1, Var2, fill=Value))+
scale_x_discrete(limits=order$x)+ scale_x_discrete(limits=order$x)+
scale_y_discrete(limits=order$y)+ scale_y_discrete(limits=order$y)+
theme_heatmap(line.color="black")+
theme_heatmap(line.color=color)+
geom_text(data=df.pval, aes(label=round(Value, 2))) geom_text(data=df.pval, aes(label=round(Value, 2)))
} }

Loading…
Cancel
Save