3
私はRに慣れていないので、素朴な質問を許してください。私はRブロガーに見て適応したコードを使って森林プロットを生成しました。私は脚注を追加したいと思いますが、どうすればよいか分かりません。私はさまざまなコードを見てきましたが、どのコードが適切かわかりません。どんなアドバイスも大歓迎です!ありがとう!forestplot Rパッケージを使用している場合、どのように脚注を追加しますか?
フォレストプロットコードは以下である:
library(ggplot2)
library(grid)
library(gridExtra)
library(xtable)
library(plyr)
library(MASS)
library(reshape2)
d1 <- read.csv("/view/name_view/vob/folder/subfolder/forestTAF.csv", stringsAsFactors=FALSE)
#Format data so column labels and columns match required graphical output
subgps <- c(4,5,8,9,12,13,16,17,20,21,24,25,28,29)
#Combine the rest of the columns in the table
tabletext <- cbind(c("Change due to", d1$Variable),
c("PK Measures", d1$PK.Measures),
c("Recommendation", d1$Recommendation))
#Load forestplot package
library(forestplot)
#Create forest plot
png(filename="forestTAF.png",width=1600, height=640)
forestplot(labeltext=tabletext, graph.pos=3, align=c("l", "c", "l"),
mean=c(NA,d1$Point.Estimate),
lower=c(NA,d1$Low), upper=c(NA,d1$High),
title="Drugname \nFold Change and 90% CI",
xlab="Change Relative to Reference (i.e., without interaction)",
txt_gp=fpTxtGp(label=gpar(cex=1.25),
ticks=gpar(cex=1.1),
xlab=gpar(cex = 1.2),
title=gpar(cex = 1.2)),
col=fpColors(box="black", lines="black"),
zero=1, cex=0.9, lineheight = "auto", boxsize=0.5, colgap=unit(6,"mm"),
lwd.ci=2, ci.vertices=TRUE, ci.vertices.height = 0.4)
、そんなに@rawrをありがとうございます!最初のコードはトリックでした:-) – Christina