R WYSIWYG - Osaka Kyoiku Universityex.osaka-kyoiku.ac.jp/~fujii/2014/Rjapanese.pdf• R Graph...

6
R WYSIWYG R R family PDF family = "Japan1" PDF PDF PDF key = value key family value key value .Rprofile setHook(packageEvent("grDevices", "onLoad"), function(...) { ... ## grDevices::windowsFonts( mincho = grDevices::windowsFont("MS Mincho"), gothic = grDevices::windowsFont("MS Gothic") ); ## PDF grDevices::pdfFonts( mincho = grDevices::pdfFonts()$Japan1, gothic = grDevices::pdfFonts()$Japan1GothicBBB ); }); PDF PDF CIDFont() CID family = "mincho" MS PDF PDF family Rdevga PDF .Rprofile > plot(1:5, type="n") > text(2, 3, " ") > text(3, 3, " ", family="mincho") > text(4, 3, " ", family="gothic") > dev.copy2pdf(file="plot.pdf") par(family = "mincho") pdf(file = "plot.pdf") R 1/6 R - 2014/09/01 file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

Transcript of R WYSIWYG - Osaka Kyoiku Universityex.osaka-kyoiku.ac.jp/~fujii/2014/Rjapanese.pdf• R Graph...

R WYSIWYG R

R family PDF

family = "Japan1"

PDF

PDF PDF

key = value key family value key value

.Rprofile

setHook(packageEvent("grDevices", "onLoad"), function(...) {

...

## grDevices::windowsFonts( mincho = grDevices::windowsFont("MS Mincho"), gothic = grDevices::windowsFont("MS Gothic") );

## PDF grDevices::pdfFonts( mincho = grDevices::pdfFonts()$Japan1, gothic = grDevices::pdfFonts()$Japan1GothicBBB ); });

PDF PDF CIDFont() CID

family = "mincho" MS PDF PDF

family Rdevga PDF .Rprofile

> plot(1:5, type="n") > text(2, 3, " ") > text(3, 3, " ", family="mincho") > text(4, 3, " ", family="gothic") > dev.copy2pdf(file="plot.pdf")

par(family = "mincho") pdf(file = "plot.pdf")

R

1/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

R PDF Rdevga .Rprofile

Rdevga

## TT MS Gothic : plain TT MS Gothic : bold TT MS Gothic : italic TT MS Gothic : bold&italic

.Rprofile

## PDF setHook(packageEvent("grDevices", "onLoad"), function(...) { grDevices::pdf.options(family="Japan1GothicBBB"); ## });

Mac OS X LinuxRdevga .Rprofile

> names(windowsFonts()) ## > windowsFonts(mincho=windowsFont("MS Mincho")) ## MS > par(family="mincho") > plot(...)

serif sans mono family

PDF

PDF Japan1

> names(pdfFonts()) ## > pdf(file="plot.pdf", family="Japan1") ## > plot(...)

familyJapan1 KozMinPro-Regular-AcroJapan1HeiMin HeiseiMin-W3-AcroJapan1Ryumin Ryumin-LightJapan1GothicBBB GothicBBB-Medium

PDF

PDF PDF

family = "Japan1"

family PDF family

2001-01-01

R R

Evernote

2/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

• The R Project for Statistical Computing◦ The Comprehensive R Archive Network CRAN◦ The R Journal

• RjpWiki

• RStudio• Emacs + ESS Emacs Speaks Statistics

◦ Meadow◦ NTEmacs

◾ gnupack cygwin + emacs package NTEmacs◦ Cocoa Emacs

• Rcmdr R Commander R GUI

• Quick-R◦ scratch-R

• seekR• RSeek.org• R Site Search

• R Graph Gallery• R Graphical Manual

• Notes on the use of R for psychology experiments and questionnaires• Using R for psychological research: A simple guide to an elegant package

• An Introduction to R• Introductory Statistics With R (Statistics and Computing)

◦ R• Statistics: An Introduction using R

◦ :R• R R

◦ ( ) I

• Statistical Computing: An Introduction to Data Analysis using S-Plus• Data Analysis and Graphics Using R: An Example-based Approach (Cambridge Series in Statistical and Probabilistic

Mathematics)• A Handbook of Statistical Analyses Using R

◦ R

• R Cookbook (O'Reilly Cookbooks)◦ R

• R Graphics Cookbook◦ R ―ggplot2

3/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

• R Graph Cookbook: Detailes Hands-on Recipes for Creating the Most Useful Types of Graphs in R - Starting from the Simplest Versions to More Advanced Applications

• R• R

• Linear Models with R (Chapman & Hall/CRC Texts in Statistical Science)• Extending the Linear Model with R: Generalized Linear, Mixed Effects and Nonparametric Regression Models (Chapman &

Hall/CRC Texts in Statistical Science)

R

Windows R R User Configuration

1. $HOME2.

◦ .Rprofile◦ Rconsole◦ Rdevga

3. R .Renviron $R_LIBS_USER

Windows $R_USER $R_USER $HOME R Mac OS X Linux

$HOME

$HOME

R_USERWindows$HOME $HOME

R_LIBS_USER Windows${R_USER}/R/win-library/x.y x.y R R x.y.z

R_ENVIRON_USER R .Renviron R_PROFILE_USER R .Rprofile

R R $R_LIBS_USER

$R_LIBS_USER

%V 2.5.0%v 2.5%p R.version$platform i386-pc-mingw32%o R.version$os mingw32%a CPU R.version$arch i386

R

4/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

R_HOME R R_LIBS $R_LIBS_USERR_ENVIRON R Renviron.site R_PROFILE R Rprofile.site

R

HOMELC_ALLLANGUAGETZ

R_HISTFILE .Rhistory

R_HISTSIZE

Renviron

R Renviron.site .Renviron

R

1. $R_ENVIRON2. ${R_HOME}/etc/Renviron.site

1. $R_ENVIRON_USER2. .Renviron3. .Renviron

Rprofile

R Rprofile.site .Rprofile

R

1. $R_PROFILE2. ${R_HOME}/etc/Rprofile.site

1. $R_PROFILE_USER2. .Rprofile3. .Rprofile

base base local()

.Rprofile .Rprofile

5/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...

Rprofile .First() .Last() R

# .First <- function() { cat("\n --- Welcome! --- \n"); }

# .Last <- function() { cat("\n --- Good-bye! --- \n"); }

Rconsole Windows

R ${R_USER}/Rconsole R Console

$R_HOME/etc $HOMER → GUI

... Save... Rconsole

MS Gothic TT TrueType

font = TT MS Gothic

R loadRconsole()

Rdevga Windows

plot() ${R_USER}/Rdevga

$R_HOME/etc $HOMEUNIX LF

4

TT Arial : plain TT Arial : bold TT Arial : italic TT Arial : bold&italic

4 Arial MS Gothic Rconsole font

TT MS Gothic : plain TT MS Gothic : bold TT MS Gothic : italic TT MS Gothic : bold&italic

Rdevga Windows plot() PDF Rprofile pdf.options(...)

TITLE:R - DATE:2014 9 1URL:http://amano41.hateblo.jp/category/R

6/6R -

2014/09/01file:///C:/Users/Fujii/Documents/Kami%20Data/comp/____R%20 ...