R 绘制欧元符号€;在GG2中?

R 绘制欧元符号€;在GG2中?,r,ggplot2,euro,R,Ggplot2,Euro,欧元符号€在PDF输出中显示为.. ggplot() + theme_bw() + geom_line() + scale_y_continuous(formatter = "euro") 启动PDF图形时使用ISOLatin9.enc编码 pdf(encoding = "ISOLatin9.enc") 据说,欧元符号可以选择ISO-8895-15(拉丁语-9),其字符为欧元 #1。方法1 图书馆(比例尺) 欧元% 格式货币(c('A'),'\U20AC',数字=0)%>% 格式货币(c('

欧元符号
在PDF输出中显示为
..

ggplot() + theme_bw() + geom_line() + scale_y_continuous(formatter = "euro")

启动PDF图形时使用
ISOLatin9.enc
编码

pdf(encoding = "ISOLatin9.enc")

据说,欧元符号可以选择ISO-8895-15(拉丁语-9),其字符为欧元

#1。方法1
图书馆(比例尺)
欧元%
格式货币(c('A'),'\U20AC',数字=0)%>%
格式货币(c('c'))%>%
格式百分比('D',2)
希望其中一个能有用

 # 1. Method 1
 library(scales)
 euro <- dollar_format(prefix = "\u20ac", big.mark = ",")
 euro(20)

 # 2. Method 2
 library(formattable)
 currency(20, symbol = "\U20AC", digits = 0)

 # 3. Method 3

 # 3.1. Load package
 library(DT)

 # 3.2. Create data set
 m = cbind(matrix(rnorm(120, 1e5, 1e6), 40), runif(40), rnorm(40, 100))
 colnames(m) = head(LETTERS, ncol(m))
 m

 # 3.3. Format the columns 'A' (euro), 'C' (usd), and 'D' (percentages)
 datatable(m) %>% 
   formatCurrency(c('A'), '\U20AC', digits = 0) %>% 
   formatCurrency(c('C')) %>% 
   formatPercentage('D', 2)