Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. metaan <-
  2. structure(list(
  3. mean = c(NA, NA, NA, 0.27, 0.47, 0.33, 0.69, 0.86, 0.37, 0.08, 0.44, 0.54, 0.41, NA),
  4. lower = c(NA, NA, NA, 0.13, 0.12, 0.19, 0.12, 0.54, 0.17, 0.03, 0.16, 0.06, 0.29, NA),
  5. upper = c(NA, NA, NA, 0.58, 1.81, 0.60, 3.97, 1.36, 0.81, 0.21, 1.25, 4.50, 0.58, NA)),
  6. .Names = c("mean", "lower", "upper"),
  7. row.names = c(NA, -27L),
  8. class = "data.frame")
  9.  
  10. tabletext<-cbind(
  11. c("", "AB class", "", " Aminoglycosides", " B-lactams", " Cephalosporins", " Fenicoles", " Fluoroquinolones", " Multiresistance", " Sulphamides", " Tetracyclines", " Tri/Sulpha", " Subtotal", ""),
  12. c("", "OR", "", "0.27", "0.47", "0.33", "0.69", "0.86", "0.37", "0.08", "0.44", "0.54", "0.41", ""),
  13. c("", "n", "", "4", "3", "2", "3", "4", "2", "3", "4", "3", "5", ""))
  14.  
  15. xticks <- c(0.1, 0.25, 0.5, 1, 1.5, 2, 3)
  16.  
  17. forestplot(tabletext,
  18. graph.pos = 3,
  19. txt_gp = fpTxtGp(label = gpar(fontsize=10)),
  20. hrzl_lines = list("3" = gpar(lty=1)),
  21. zero = 1,
  22. line.margin = .05,
  23. mean = cbind(metaan[,"mean"]),
  24. lower = cbind(metaan[,"lower"]),
  25. upper = cbind(metaan[,"upper"]),
  26. is.summary=c(FALSE, TRUE, rep(FALSE, 9)),
  27. col=fpColors(box=c("blue"), summary=c("blue")),
  28. grid = structure(0.41,
  29. gp = gpar(lty = 2, col = "#CCCCFF")),
  30. clip=c(0.1, 3),
  31. xlog=T,
  32. xticks=xticks,
  33. xlab="Odds ratio")
  34.  
  35. forestplot(tabletext,
  36. graph.pos = 3,
  37. txt_gp = fpTxtGp(label = gpar(fontsize=10)),
  38. hrzl_lines = list("3" = gpar(lty=1)),
  39. zero = 1,
  40. line.margin = .05,
  41. mean = cbind(metaan[,"mean"]),
  42. lower = cbind(metaan[,"lower"]),
  43. upper = cbind(metaan[,"upper"]),
  44. is.summary=c(FALSE, TRUE, rep(FALSE, 9)),
  45. col=fpColors(box=c("blue"), summary=c("blue")),
  46. grid = structure(-0.39,
  47. gp = gpar(lty = 2, col = "#CCCCFF")),
  48. clip=c(0.1, 3),
  49. xlog=T,
  50. xticks=xticks,
  51. xlab="Odds ratio")
  52.  
  53. Error in forestplot.default(tabletext, graph.pos = 3, txt_gp = fpTxtGp(label = gpar(fontsize = 10)), :
  54. All argument values (mean, lower, upper, zero, grid and clip) should be provided as exponentials when using the log scale. This is an intentional break with the original forestplot function in order to simplify other arguments such as ticks, clips, and more.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement