[R] How to handle Chinese character in R plot?
jszhao at yeah.net
Fri Oct 12 05:01:01 CEST 2012
On 2012-10-12 10:16, Manish Gupta wrote:
> I am working on Chinese language plot.
> But names and labels are in chinese language. How can i print chineese
> characters as lable in R plot.
> 名称 类 学生
> 木材 2 2
> 表 3 4
> 笔 4 2
> 垃圾桶 5 6
> 杯 6 3
> like we can do in excel as shown below in image.
try the following code:
x <- read.csv(textConnection("
杯,6,3"), header = TRUE)
rownames(x) <- x[,1]
x <- x[,-1]
barplot(t(x), horiz = TRUE, beside = TRUE, legend.text = TRUE)
More information about the R-help