library(ropencc) cc = converter(S2T) ## T2S means Traditional Chinese to Simplified Chinese. ## S2T means Simplified Chinese to Traditional Chinese. run_convert(cc,'我是谁') [1]"我是誰"
字体一般可以通过全局变量 par 中的 family
来设定,但有些需要特殊设定,比如 igraph 包中的绘图情况:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
library(igraph) library(tidyverse) x <- read.table(textConnection(" 物理,化学 化学,生物 英语,数学 数学,语文 语文,化学"), sep =',', stringsAsFactors =F) x <- x %>% mutate( V1 = iconv(V1,'UTF-8','UTF-8'), V2 = iconv(V2,'UTF-8','UTF-8') )
g <- graph_from_data_frame(x) plot(g, vertex.label.family='Noto Sans SC Light')