首页 > 解决方案 > 如何参数化geom_text中的label子句?

问题描述

想在其中创建一个带有 ggplot 的函数。如何参数化下面需要在多个函数调用之间变化的这个标签子句?

geom_text(aes(label = round(value, 3), 
geom_text(aes(label = round(value / 1e06, 0), 
geom_text(aes(label = 100 * round(value, 3), 

我在想: label = p_label - 其中 p_label 将是等号右侧的所有内容,以逗号表示。这在R中可能吗?

传递字符串不起作用,尝试了c(),也没有运气。

标签: rfunctionggplot2parameters

解决方案


推荐阅读