【发布时间】:2018-09-19 07:22:18
【问题描述】:
我正在尝试绘制树状图。我已经安装了所有必要的软件包:
install.packages("ggplot2")
install.packages("reshape2")
install.packages("plyr")
install.packages("devtools")
我的代码的第一部分运行良好:
library(treemapify)
library(devtools)
treeMapCoordinates <- treemapify(df,
area = "MMR_Count",
fill = "MMR_Count",
label = "Business",
group = "Year")
这里是错误发生的地方:
treeMapPlot <- ggplotify(treeMapCoordinates)
这是错误信息:
ggplotify(treeMapCoordinates) 中的错误: 找不到函数“ggplotify”
我在哪里做错了?
【问题讨论】:
-
搜索 google,你得到的第一个结果是
ggplotify的文档,它表明它是包treemapify中的一个函数。 rdocumentation.org/packages/treemapify/versions/0.2.2/topics/… -
@JackBrookes 我已经安装了 Treemapify,这就是为什么它没有调用的问题
-
github.com/wilkox/treemapify/… ,所以尝试使用
geom_treemap -
@user20650 是的,treemapify 已被贬低,geom_treemap 是新功能,我可以使用它,谢谢!