Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Eliza1994
Regular Visitor

How to change the font( language) with R Visuals(library qcc)

Anyone kindly help me to figure out how to change the font(language) into Japanese with R Visuals?

 

I am a Power BI user in Japan and trying to draw a fishbone visual with R(qcc).

I find the script below and draw a fishbone diagram successfully.

-------------------------------------------------------------------------------------------------

install.packages(qcc)
library(qcc)
cause.and.effect(cause=list(Measurements=c("Micrometers","Micrometers","Inspectors"),
Materials=c("Alloys","Lubricants","Suppliers"),
Environment=c("Condensation","Moisture"),
Methods=c("Brake","Engager","Angle"),
Machines=c("Speed","Bits","Sockets")),
effect = "Surface Flaws")
Eliza1994_0-1644976806600.png

-------------------------------------------------------------------------------------------------

However, once I changed the contents into Japanese, the visual failed to show a result.

Eliza1994_1-1644977058632.png

library(qcc)
cause.and.effect(cause=list(軸の素材=c("仕入先変更"),
作業者=c("作業者ミス","トレーニング充実度"),
加工過程=c("最大ワークロード超えた","挽回生産予定数多い"),
設備=c("経年劣化","メンテナンス不足")),
effect = "軸受け破損")
 
Is there any way to draw the diagram in Japanese?
Any help is appreciated.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Eliza1994 ,

 

It looks like R has a hard time reading in non-English characters in as text.

Maybe these options can help you :

  1. In RStudio, try going in Tool > Global Options > Code > Saving > and then choose the right encoding for Japanese and Mandarin. The UTF-8 enconding might work for you.
  2. The blog post Escaping from character encoding hell in R on Windows explains how to set the encoding to import external documents. It should work with data imported with RODBC as well. The autor uses Japanese characters in his examples.
  3. In the odbcDriverConnect() function of the RODBC package, the argument DBMSencoding="UTF-8" might work for you.
  4. To have the correct characters, you may need to specify the encoding: readLines(url, encoding="UTF-8")

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Eliza1994 ,

 

It looks like R has a hard time reading in non-English characters in as text.

Maybe these options can help you :

  1. In RStudio, try going in Tool > Global Options > Code > Saving > and then choose the right encoding for Japanese and Mandarin. The UTF-8 enconding might work for you.
  2. The blog post Escaping from character encoding hell in R on Windows explains how to set the encoding to import external documents. It should work with data imported with RODBC as well. The autor uses Japanese characters in his examples.
  3. In the odbcDriverConnect() function of the RODBC package, the argument DBMSencoding="UTF-8" might work for you.
  4. To have the correct characters, you may need to specify the encoding: readLines(url, encoding="UTF-8")

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.