R语言绘制森林图-forestplot

更新时间:2023-06-04 20:40:10 阅读: 评论:0

R语⾔绘制森林图-forestplot ####森林图绘制 forestplot
#### A practice for forest plot
##t your working directory
workdir <- "D:/R"
twd(workdir)
datafile <- file.path(workdir,"ForestPlotData.csv")微信消息延迟
data <- read.csv(datafile, stringsAsFactors=FALSE)
data[1:5,1:5]
## 定义亚组
subgps <- c(4,5,8,9,12,13,16,17,20,21,24,25,28,29,32,33)
data$Variable[subgps] <- paste("  ",data$Variable[subgps])
## Combine the count and percent column,以括号相连
np <- ifel(!is.na(data$Count), paste(data$Count," (",data$Percent,")",p=""), NA)
## The rest of the columns in the table.
tabletext <- cbind(c("Subgroup","\n",data$Variable),
c("No. of Patients (%)","\n",np),
c("4-Yr Cum. Event Rate\n PCI","\n",data$PCI.Group),
c("4-Yr Cum. Event Rate\n Medical Therapy","\n",data$Medical.Therapy.Group),
红色男爵c("P Value","\n",data$P.Value))
##
library(forestplot)
png(filename = "Forestplot.png",width=960, height=640)怎样做炸鸡腿
forestplot(labeltext=tabletext, graph.pos=3,
mean=c(NA,NA,data$Point.Estimate),
座位的拼音lower=c(NA,NA,data$Low), upper=c(NA,NA,data$High),
title="Hazard Ratio",
##定义x轴我的心儿怦怦跳作文400字
xlab="    <---PCI Better---    ---Medical Therapy Better--->",
##设置透明条位置返聘协议
hrzl_lines=list("3" = gpar(lwd=1, col="#99999922"),
"7" = gpar(lwd=60, lineend="butt", columns=c(2:6), col="#99999922"),
"15" = gpar(lwd=60, lineend="butt", columns=c(2:6), col="#99999922"),
"23" = gpar(lwd=60, lineend="butt", columns=c(2:6), col="#99999922"),
白菜猪肉
"31" = gpar(lwd=60, lineend="butt", columns=c(2:6), col="#99999922")),好歌词
txt_gp=fpTxtGp(label=gpar(cex=1.25),

本文发布于:2023-06-04 20:40:10,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/864175.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:消息   透明   绘制   红色   拼音
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图