- 追加された行はこの色です。
- 削除された行はこの色です。
[[Rの備忘録]]
自分で R をコンパイルする場合,以下が必要
sudo apt-get install libcairo2-dev
sudo apt-get install libxt-dev
ライブラリをインストール
install.packages("Cairo")
library(Cairo)
# フォントの確認
CairoFontMatch(font = "gothic")
# つかえるフォントは
$ fc-list
# フォントの設定
CairoFonts(regular="VL Gothic:style=regular")
例えば
CairoFonts(
regular="IPA P明朝,IPAPMincho:style=Regular",
bold="IPA Pゴシック,IPAPGothic:style=Regular,Bold",
italic="IPA P明朝,IPAPMincho:style=Regular,Italic",
bolditalic="IPA Pゴシック,IPAPGothic:style=Regular,Bold Italic,BoldItalic")
CairoFonts(regular="VL ゴシック,VL Gothic:style=regular")
CairoFonts(regular="IPA P明朝,IPAPMincho:style=Regular")
# CairoFonts(regular="VL Gothic:style=regular")
# ディスプレイに表示
CairoX11()
biplot(res.pc, cex = 1.2)
# PDF を作成
# PDF PS を作成 # パスは絶対パス,チルダやドットは使えない
CairoPDF(file = "hoge.pdf")
biplot(res.pc, cex = 1.2)
dev.off()
CairoPS(file = "Fig1.6", bg="white")
dev.off()
# 他に CairoPNG CairoPS などの関数もある
?Cairo