ggformaEnglish

切换图表显示语言

函数索引 / 语言与字典

locale_forma()

给已有图形添加语言组件,翻译已登记的标签、分类及 ggforma 管理的分面文字。

怎么用

使用 p + locale_forma(...),按需提供自定义字典。对象保留原始分类键、颜色映射、统计结果和坐标。作者自行设置的标度及分面标签保持其原有设置。

返回结果

返回可加入 ggplot2 图形的组件。添加组件后仍然得到标准 ggplot。

调用方式

locale_forma(lang, dictionary = NULL, region = NULL, ..., labels = NULL)

参数

lang、dictionary、region、...、labels

逐项参数说明(英文)

R 示例

d <- data.frame(site = c("N", "S"), n = c(16, 24))
dict <- data.frame(variable = "site", id = c("N", "S"), lang = "en",
                   label = c("North", "South"))
ggpie(d, "site", "n") + locale_forma("en", dictionary = dict)

查看完整英文文档