我正在尝试使用ggtern包来绘制一些图形。它曾经在ggplot2上运行,但现在不起作用并破坏了ggplot2。
当我运行以下内容时:
library(ggplot2)
qplot(1,2)
library(ggtern)
qplot(3,4)
df = data.frame(x = runif(50),
y = runif(50),
z = runif(50),
Value = runif(50,1,10),
Group = as.factor(round(runif(50,1,2))))
ggtern(data=df,aes(x,y,z,color=Group)) +
theme_rgbw() +
geom_point() + geom_path() +
labs(x="X",y="Y",z="Z",title="Title")
qplot(1,2)
可以正常工作,library(ggtern)
给了我这个(可能与问题有关):
Attaching package: ‘ggtern’
The following objects are masked from ‘package:ggplot2’:
%+%, %+replace%, aes, calc_element, Geom, geom_segment, ggplot_build,
ggplot_gtable, ggsave, theme, theme_bw, theme_classic, theme_get, theme_gray,
theme_grey, theme_minimal, theme_set, theme_update
qplot(3,4)
失败,显示如下:
Error in FUN(X[[i]], ...) : attempt to apply non-function
如果我将其注释掉,然后运行到ggtern(...
这一步,会出现这种情况:
Error in coord_tern() : could not find function "coord"
显然出了问题。我应该从哪里开始找出问题?这个函数
coord
是什么,为什么它消失了?
gtern
现在已经因为新包而失效。维护者显然不在身边进行必要的更改。 - Mike Wise