Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfactoextra and japanese text #31
Comments
|
factoextra depends on ggpubr to create scatter plots. Please, install the latest developmental version of factoextra and ggpur as follow: if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")
devtools::install_github("kassambara/factoextra")Then, try this: library(FactoMineR)
library(factoextra)
.tbl2.1 <- matrix(c(395, 2456,1758,
147, 153, 916,
694, 327, 1347),byrow=T,3,3)
dimnames(.tbl2.1) <- list(地域=c("オスロ","中部地域","北部地域"),
犯罪=c("強盗", "詐欺","破壊") )
res.CA <- CA(.tbl2.1,graph=FALSE)
fviz_ca_biplot(res.CA,map="simbiplot",title="simbiplot",
font.family = "HiraKakuProN-W3") |
|
Thank you for your advice, I could use Japanese Font correctly. (** May be this my RStudio setting issue, the graph out put to plot window, Japanese still □ . In the PDF output by knitr, I can see Japanse FONT, and by Export form plot window, it also good. If anyone have some advice, I will be happy ;-)) kazuo |
|
Great that it works! Concerning the problem with RStudio plot window, these forums might help: |
|
kassambara, #Thank you for your support.
title is not displayed.
reagrds. |
|
Thank you for pointing this out. I updated now the ggpubr package (which is used by factoextra for drawing scatter plot). It should work now. Please install the latest developmental version of ggpubr before testing: if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")Kind regards |
|
KASSAMBARA,
I check the function. It works !
Thank you for your support.
ggpubr version is 0.1.2.999
I am looking forward to official release ;-)
kazuo
2017-04-24 6:46 GMT+09:00 Alboukadel KASSAMBARA <notifications@github.com>:
… Thank you for pointing this out. I updated now the ggpubr package (which
is used by factoextra for drawing scatter plot).
It should work now.
Please install the latest developmental version of ggpubr before testing:
if(!require(devtools)) install.packages("devtools")devtools::install_github("kassambara/ggpubr")
Kind regards
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH1t_cCon2ePh6TyKkZOzsT6ZsgJD6khks5ry8axgaJpZM4M9En0>
.
--
----------------------------------------------------------------------------------
kazuo fujimoto <fujimoto at sakushin-u.ac.jp>
Sakushin Gakuin University, Faculty of Human & Culture
http://www.facebook.com/fujimoto.kazuo
『対応分析入門』http://www.amazon.co.jp/dp/4274218279
-----------------------------------------------------------------------------------
|
|
KASSAMBARA, I found another problem on FONT. I made poisonJ data, with converted variable name and category into Japanese. And on the way translating this page http://www.sthda.com/english/wiki/multiple-correspondence-analysis-essentials-interpretation-and-application-to-investigate-the-associations-between-categories-of-multiple-qualitative-variables-r-software-and-data-mining Then I checked fviz_ functions which are used in above document. Then I encountered the Font problem when I use "fviz_cpntrib" ,"fviz_cos2", and with habillage option on "fviz_mca_biplot". For every cases, I have to add the "+ theme(text = element_text(family = "HiraKakuProN-W3")) ". <fviz_contrib(res.mca, choice = "ind", axes = 1:2, top = 20, font.family = "HiraKakuProN-W3") + theme(text = element_text(family = "HiraKakuProN-W3")) Is it the same issue as "Japanse title" which I asked you before ? And when I translated your "multiple-correspondence-analysis-essentials....", I have to insert same option "font.family = "HiraKakuProN-W3" for every command line. I would be very happy if I can setup this one in a .Rprofile or another setting command. Because in a one report I need same setting from the begining to the end. regards. kazuo |
|
Another problem. when I use fviz_mca_var( ) with supplyment variable included res.mca. I tried to put both "ont.family = "HiraKakuProN-W3"" and "+ theme(text = element_text(family = "HiraKakuProN-W3"))", there are no effect on it. I attached the graph with script. I use "sans" for my setting. Please read it as "HiraKakuProN-W3". |
|
Ok thanks, i'll update these functions as soon as possible |
|
fixed now, thanks! Install the latest developmental version and try this: d <- read.csv("http://419kfj.sakura.ne.jp/db/wp-content/uploads/2017/05/poison.csv")
res.mca <- MCA(d, ind.sup=53:55, quanti.sup = 1:2, quali.sup = 3:4, graph=FALSE)
my_theme <- theme_minimal(base_family = "HiraKakuProN-W3")
fviz_contrib(res.mca, "var", ggtheme = my_theme)
fviz_mca_var(res.mca, font.family = "HiraKakuProN-W3", invisible = "var" ) |
|
I check both of above with factoextra 1.0.4.999. These function works well ;-) Thank you for your support and nice packege ! kazuo |
|
Ok, great! so we can close this issue. Thanks! |



(email from a user)
I am using Mac and RStudio/R.
When I use ggplot on my Mac, I have to set the font family to "sans"
(in .Rprofile I set up the "sans" to Japanese fonts)
Like this.
Please advice me how I can select the Font for fviz_ca.