library(openxlsx)
library(readxl)
library(ggrepel)
data1 <- read_excel("L-vs-SL.xlsx",sheet = 1)
#names(data)[29:31]<-c("P","Q","Difference")
#data2 <- data[c(29:31,46,47)]
#transform(data2,data$Difference <- 1/data$Difference )
data1$P<--log10(data1$P)
data1$change <- as.factor(ifelse(data1$P > -log10(0.05) & abs(data1$Difference) > 1,ifelse(data1$Difference > 1,'UP','DOWN'),'NOT'))
p <- ggplot(data = data1, aes(x = Difference, y = P, color = change))
p <- p+ geom_point(alpha=0.8, size = 1.5)
p <- p+theme_bw(base_size = 15)
p <- p+ theme(
panel.grid.minor = element_blank(),
panel.grid.major = element_blank()
)
p <- p+geom_hline(yintercept=1.3 ,linetype=4)
p <- p+geom_vline(xintercept=c(-1,1) ,linetype=4 )
p <- p+scale_color_manual(name = "", values = c("red", "blue", "black"), limits = c("UP", "DOWN", "NOT"))
p <- p+ coord_fixed(ratio=1.5/1)
p <- p+ geom_label_repel(aes(label=symbol), fontface="bold", color="grey10", box.padding=unit(0.35, "lines"), point.padding=unit(1, "lines"), segment.colour = "grey10")
p
library(ggplotify)
library(eoffice)
f = "L_SL.pptx"
topptx(p,f,width=8,height=6)
2021-05-03
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...