我一直在和R Markdown一起探索并遇到了这个问题.我在网上找到的所有可重现的示例报告,例如http://jeromyanglim.blogspot.ca/2012/05/example-reproducile-report-using-r.html,其代码后跟结果.
我想得到结果,因此隐藏了观众的代码.例如,我只想显示ggplot2或googlevis的最终结果,而不显示加载数据和编码的长行.
有办法吗?
可能重复:
使用ggplot2创建包含预先汇总数据的条形图
在ggplot2参考手册 http://had.co.nz/ggplot2/geom_bar.html
我们可以看到使用提供的钻石数据可以很容易地叠加条形图.
但是,我尝试使用的数据集与钻石数据不同,因为我已经对其进行了总结.
附件是我的意思的最小例子
AgeGroup gender Level.of.Education status count
1 18-25 male High School married 10
2 18-25 male High School single 20
3 18-25 male College married 25
4 18-25 male College single 10
5 18-25 male PhD married 50
6 18-25 male PhD single 4
7 18-25 male GED married 20
8 18-25 male GED single 100
9 18-25 female High School married 20
10 18-25 female High School single 10
11 18-25 female College …Run Code Online (Sandbox Code Playgroud)