使用R创建树形图以显示案件数
问题描述:
我需要创建一个类似于树形图的图形来表示不同情况下的案例数,如下所示:
I need to create a "tree diagram"-like graph to present the number of cases for different scenarios, like the one shown below:
图片引自:
Pediatrics. 2005 Dec;116(6):1317-22.
Electronic surveillance system for monitoring surgical antimicrobial prophylaxis.
Voit SB, Todd JK, Nelson B, Nyquist AC.
我可以使用表$ c从R轻松获得数字$ c>命令,但这不是呈现它的一种很好的方法。
I can get the numbers easily from R using the table
command, but it is not a very good way to present it.
可以制作图表而没有任何奇特的颜色或东西,我只想使用格式以显示数字。有建议吗?
The chart can be made without any fancy colors or stuff, I just want to use the format to present the numbers. Any suggestions?
答
可以使用关系图包来绘制树形图。它是用于绘制流程图等的通用软件包。请参见
The tree diagram could be drawn using the "diagram" package. It is a generic package for drawing flow diagrams etc. See
library(diagram)
demo("flowchart")