Назначение цвета в ящиках лесного участка не работает - PullRequest
0 голосов
/ 27 мая 2020

Я строю лесной участок и столкнулся с проблемой цвета ящиков. Когда я назначаю прямоугольникам два разных цвета, работает только тот, который я печатаю. Любая помощь будет оценена :) Заранее спасибо!

data<- data.frame(
  coef =c(NA, NA, NA, 1.85, 1.86, 1.88, 1.45, 1.64, 1.54, 1.45, 1.64, 1.54, 1.45, 1.64, 1.54, 1.45, 1.64, 1.54, 1.85, 1.86, 1.88, 5.85, 5.86, 5.88, 3.33),
  low  =c(NA, NA, NA, 1.45, 1.25, 1.30, 1.10, 1.20, 1.25, 1.15, 1.30, 1.15, 1.15, 1.30, 1.15, 1.15, 1.30, 1.15, 1.45, 1.25, 1.30, 3.45, 3.25, 3.30, 1.45),
  high =c(NA, NA, NA, 2.52, 2.10, 2.30, 2.54, 2.52, 2.25, 2.54, 2.52, 2.25, 2.54, 2.52, 2.25, 3.54, 3.52, 3.25, 2.52, 2.10, 2.30, 7.52, 7.10, 7.30, 5.45)
)


tabletext<- cbind(
  c("Comorbidities", "", "", "Diabetes", "", "Heart disease", "", "Stroke", "", "COPD", "", "Asthma", "", "Cancer", "", "Arthtitis", "", "Osteoporosis", "", "Depression", "", "Severe mental diseases", "", "Dementia", ""),
  c("Model adjustment", "", "", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor", "Age, Sex", "Multi-factor"))

forestplot(tabletext, 
           data, 
           new_page = TRUE,
           clip=c(0, 8), 
           xlog=F,
           xlab = "Odds ratio (95% CI)",
           graph.pos = 2,
           zero= 1,
           line.margin = 0.1,
           hrzl_lines = list("3" = gpar(lty=1, lwd=2, col= "black"),
                             "5" = gpar(lwd=40, lineend="butt", col="#99999922"),
                             "9" = gpar(lwd=40, lineend="butt", col="#99999922"),
                             "13" = gpar(lwd=40, lineend="butt", col="#99999922"),
                             "17" = gpar(lwd=40, lineend="butt", col="#99999922"),
                             "21" = gpar(lwd=40, lineend="butt", col="#99999922"),
                             "25" = gpar(lwd=40, lineend="butt", col="#99999922")),
           boxsize = 0.6,
           title = "Comorbidities in individuals with inflammatory bowel disease",
           vertices = T,
           txt_gp = fpTxtGp(label = list(gpar(fontfamily = "Times New Roman", cex=1),
                                         xlab  = gpar(fontfamily = "Times New Roman", cex=1),
                                         ticks = gpar(fontfamily = "Times New Roman", cex=0.8),
                                         title = gpar(fontfamily = "Times New Roman", cex=1.2))),
           fn.ci_norm =  c(fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI, fpDrawCircleCI, fpDrawNormalCI, fpDrawCircleCI,
                           fpDrawNormalCI),
           col = fpColors(box= c("red", "black"), lines =c ("red", "black"), zero= "black"))
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...