在新的ggplot2上运行ggtern似乎有问题。我曾尝试加载R、ggtern和ggplot2的早期版本,但无法使它们正常工作。使用最新版本时,我得到以下错误:
错误: geom_point需要以下缺少的美学元素:x和y
rlang::last_error()
<error/rlang_error>
geom_point requires the following missing aesthetics: x and y
Backtrace:
(function (x, ...) ...
ggtern:::print.ggplot(x)
ggtern:::ggplot_build.ggplot(x)
ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
ggtern:::f(l = layers[[i]], d = data[[i]])
l$compute_geom_1(d)
ggplot2:::f(..., self = self)
ggplot2:::check_required_aesthetics(...)
rlang::last_trace()
<error/rlang_error>
geom_point requires the following missing aesthetics: x and y
Backtrace:
x
+-(function (x, ...) ...
-ggtern:::print.ggplot(x)
+-ggtern::ggplot_build(x)
-ggtern:::ggplot_build.ggplot(x)
\-ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
\-ggtern:::f(l = layers[[i]], d = data[[i]])
\-l$compute_geom_1(d)
\-ggplot2:::f(..., self = self)
\-ggplot2:::check_required_aesthetics(...)我也尝试过在加载ggplot2之前加载RStudio,并加载了每个包以及R和ggtern的早期版本。
救命!
发布于 2021-07-13 03:11:44
ggplot2与最新版本的ggtern不兼容。你应该使用3.2.1版(或者3.3.0版)
require(devtools)
install_version("ggplot2", version = "3.2.1", repos = "http://cran.us.r-project.org")如果您需要其他的整洁的诗句包,您将不得不单独加载它们。
发布于 2021-07-22 11:19:10
我发现让ggtern再次工作的版本组合是:
R 4.0.2 ggplot2: 3.3.2 ggtern: 3.3.0 -忽略警告...
Kind关于Knighty16
https://stackoverflow.com/questions/68344592
复制相似问题