
library(grid)
library(forestplot)
library(tidyverse)
library(lubridate)
library(dplyr)
dat<-read.csv("E:/BaiduSyncdisk/nhanes2023/PFOASUBM1.csv",header=F,sep=",",na.strings = "")

data2<-dat[-1,2:4]
datana<-c(NA,NA,NA)
data3<-rbind(datana,data2)
data4<-as.data.frame(dat[,1:4])

pdf("E:/BaiduSyncdisk/nhanes2023/PFOA SUBM1.pdf")
forestplot( as.matrix(dat[,c(1,5)]),mean=data3[,1], lower=data3[,2], upper=data3[,3],
            txt_gp=fpTxtGp(label=list(gpar(cex = 0.7,fontface=2),gpar(cex = 0.7),gpar(cex = 0.7),gpar(cex = 0.7)),ticks=gpar(cex=0.7),xlab=gpar(cex = 0.7),title=gpar(cex = 1.2)),
            graph.pos= 2, graphwidth = unit(50,"mm"),graphheight= unit(200,"mm") , 
            boxsize=0.3, line.margin=unit(1,"mm"),lwd.ci = 2,lty.zero=2,lwd.zero=0.5,
            lineheight = unit(6,'mm'), colgap = unit(8,"mm"), zero=0, xticks = c(-0.05,0,0.05,0.1),
            col = fpColors(box = c("#23806A"),line = c("#32B897")))
dev.off()
# ¹¹½¨Êý¾Ý
dat<-read.csv("E:/BaiduSyncdisk/nhanes2023/PFNASUBM1.csv",header=F,sep=",",na.strings = "")

data2<-dat[-1,2:4]
datana<-c(NA,NA,NA)
data3<-rbind(datana,data2)
data4<-as.data.frame(dat[,1:4])

pdf("E:/BaiduSyncdisk/nhanes2023/PFNA SUBM1.pdf")
forestplot( as.matrix(dat[,c(1,5)]),mean=data3[,1], lower=data3[,2], upper=data3[,3],
            txt_gp=fpTxtGp(label=list(gpar(cex = 0.7,fontface=2),gpar(cex = 0.7),gpar(cex = 0.7),gpar(cex = 0.7)),ticks=gpar(cex=0.7),xlab=gpar(cex = 0.7),title=gpar(cex = 1.2)),
            graph.pos= 2, graphwidth = unit(50,"mm"),graphheight= unit(200,"mm") , 
            boxsize=0.3, line.margin=unit(1,"mm"),lwd.ci = 2,lty.zero=2,lwd.zero=0.5,
            lineheight = unit(6,'mm'), colgap = unit(8,"mm"), zero=0, xticks = c(-0.05,0,0.05,0.1),
            col = fpColors(box = c("#23806A"),line = c("#32B897")))

dev.off()

dat<-read.csv("E:/BaiduSyncdisk/nhanes2023/PFOSSUBM1.csv",header=F,sep=",",na.strings = "")

data2<-dat[-1,2:4]
datana<-c(NA,NA,NA)
data3<-rbind(datana,data2)
data4<-as.data.frame(dat[,1:4])

pdf("E:/BaiduSyncdisk/nhanes2023/PFOS SUBM1.pdf")
forestplot( as.matrix(dat[,c(1,5)]),mean=data3[,1], lower=data3[,2], upper=data3[,3],
            txt_gp=fpTxtGp(label=list(gpar(cex = 0.7,fontface=2),gpar(cex = 0.7),gpar(cex = 0.7),gpar(cex = 0.7)),ticks=gpar(cex=0.7),xlab=gpar(cex = 0.7),title=gpar(cex = 1.2)),
            graph.pos= 2, graphwidth = unit(50,"mm"),graphheight= unit(200,"mm") , 
            boxsize=0.3, line.margin=unit(1,"mm"),lwd.ci = 2,lty.zero=2,lwd.zero=0.5,
            lineheight = unit(6,'mm'), colgap = unit(8,"mm"), zero=0, xticks = c(-0.05,0,0.05,0.1),
            col = fpColors(box = c("#23806A"),line = c("#32B897")))

dev.off()



dat<-read.csv("E:/BaiduSyncdisk/nhanes2023/PFASSUBM1.csv",header=F,sep=",",na.strings = "")

data2<-dat[-1,2:4]
datana<-c(NA,NA,NA)
data3<-rbind(datana,data2)
data4<-as.data.frame(dat[,1:4])

pdf("E:/BaiduSyncdisk/nhanes2023/PFAS SUBM1.pdf")
forestplot( as.matrix(dat[,c(1,5)]),mean=data3[,1], lower=data3[,2], upper=data3[,3],
            txt_gp=fpTxtGp(label=list(gpar(cex = 0.7,fontface=2),gpar(cex = 0.7),gpar(cex = 0.7),gpar(cex = 0.7)),ticks=gpar(cex=0.7),xlab=gpar(cex = 0.7),title=gpar(cex = 1.2)),
            graph.pos= 2, graphwidth = unit(50,"mm"),graphheight= unit(200,"mm") , 
            boxsize=0.3, line.margin=unit(1,"mm"),lwd.ci = 2,lty.zero=2,lwd.zero=0.5,
            lineheight = unit(6,'mm'), colgap = unit(8,"mm"), zero=0, xticks = c(-0.05,0,0.05,0.1),
            col = fpColors(box = c("#23806A"),line = c("#32B897")))

dev.off()