如何添加缺失的美学:标签到 geom_label()

瓦兹德·乌拉·穆拉德

我收到以下错误:

Error: geom_label requires the following missing aesthetics: label

当我运行以下脚本时:

library(tidyverse)
library(dslabs)
data("murders")

murders %>%
  ggplot(aes(population, total, lavel=abb, color=region)) +
  geom_label()

如何添加缺少的美感或如何解决问题?

阿卜杜拉希姆·乌吉比赫

试试这个:

library(tidyverse)
library(dslabs)
data("murders")

murders %>%
  ggplot(aes(population, total, lavel=abb, color=region)) +
  geom_label(aes(population, total, label=state))

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用geom_label指示位置

如何将 geom_label 放入 geom_bar

使用 geom_label() 添加指向重要点的线

如何仅在ggplot中隐藏geom_label的图例?

如何在geom_label中使用angle?

如何添加相对于geom_point大小的位置的geom_text或geom_label?

如何在ggplot的geom_label中设置标准标签大小?

如何将bquote与ggplot2 geom_label结合使用?

如何在R ggplot的geom_label框中居中放置文本?

geom_label 中的下标

geom_label中的上标星号

在geom_label()中打印..count ..值

geom_label_repel 和 geom_label 的错误图例

带有bquote函数的geom_text / geom_label

fill参数使geom_label()中的位置参数无效

geom_label无法处理文本透明度

修复 ggplot 中 `geom_label` 的垂直位置

geom_label不会按比例缩放以在Shiny中绘图

将ggplot geom_label定位为轴限制的比例

ggplot从图例中删除geom_label边框

如何解决:geom_linerange 需要以下缺失的美学:x, ymin, ymax

ggplot2 1.01中没有更多的geom_label()吗?

自定义图例,引入未绘制但通过 geom_label 汇总的变量

ggplot2中基于`.count..`变量的`geom_label`的y值

使用ggplot将geom_label定位在网络外部?

在R中的ggplot2的geom_label的pdf输出中摆脱边界

position_dodge无法与geom_label一起使用

在 geom_label 中解析:丰富显示对象时出错:解析错误(文本 = 文本 [[i]])=

使用 \n 换行时,在 geom_label() 和 geom_text() 中减少 R ggplot 中的行高