HiroshimaR6_Introduction

161
@sakaue ご挨拶:目的と活動内容

Transcript of HiroshimaR6_Introduction

Page 1: HiroshimaR6_Introduction

阪 上 辰 也 @sakaue

ご挨拶:目的と活動内容

Page 2: HiroshimaR6_Introduction

Agenda

1. 自己紹介

2. HiRoshima.R とは

3. お知らせとお願い

Page 3: HiroshimaR6_Introduction

Agenda

1. 自己紹介

2. HiRoshima.R とは

3. お知らせとお願い

Page 4: HiroshimaR6_Introduction

1. 自己紹介

•阪上 辰也 (SAKAUE, Tatsuya)

• 所属:         外国語教育研究センター

• Nagoya.R /SappoRo.R 元主催, HiRoshima.R 主催

• 詳しくは...

Page 5: HiroshimaR6_Introduction

1. 自己紹介

Page 6: HiroshimaR6_Introduction

Agenda

1. 自己紹介

2. HiRoshima.R とは

3. お知らせとお願い

Page 7: HiroshimaR6_Introduction

2. HiRoshima.Rとは

• 広島・中国地域を中心とした R の勉強会

• 2-3ヶ月... いや半年に1度開催(目標)

• 過去の参加者 : 多くは大学・教育関係者

• 企業にお勤めの方も...

Page 8: HiroshimaR6_Introduction

なぜ HiRoshima.R?

• R ユーザー(特に入門者)を増やしたい

• HiRoshima.R を入り口・足場に

• 悩める方はどうぞいらっしゃーい

Page 9: HiroshimaR6_Introduction

なぜ HiRoshima.R?

•異分野交流(Lightning Talks)

• 人文科学・社会科学・自然科学の研究、一般企業それぞれで何してますか?

• 自分の活動・研究のヒントになるかも

Page 10: HiroshimaR6_Introduction

HiRoshima.R で何をするか

•入門者・初心者向け • インストール,起動・終了

• データ処理,関数の利用法,作図

• 統計の基礎,検定

Page 11: HiroshimaR6_Introduction

•中級+ 者向け(発表者募集中) • 統計の理論解説

• パッケージ利用

• 高度なグラフィックス作成

• シミュレーション・プログラミング

HiRoshima.R で何をするか

Page 12: HiroshimaR6_Introduction

•今後も2部構成の予定

• 第1部:入門者講習

• 第2部:Lightning Talks

• 希望の部にご参加ください

HiRoshima.R で何をするか

Page 13: HiroshimaR6_Introduction

Agenda

1. 自己紹介

2. HiRoshima.R とは

3. お知らせとお願い

Page 14: HiroshimaR6_Introduction

3つ

Page 15: HiroshimaR6_Introduction

•発表者になってください • 入門者講習の講師

• Lightning Talks

• ネタは R にかすれば何でもOK • 時間は5分から

3. お知らせとお願い

Page 16: HiroshimaR6_Introduction

•フィードバックをください • blog / twitter 経由

• #HiRoshimaR / @sakaue

• 感想,要望,賞賛,批判

3. お知らせとお願い

Page 17: HiroshimaR6_Introduction

•会場を貸してください • 東広島はちょっと不便

• 広島市内なら参加者増も期待

• 異分野交流をより盛んに

3. お知らせとお願い

Page 18: HiroshimaR6_Introduction

今後は

http://hiroshimar.connpass.com

にて情報提供を行います (のでメンバー登録だけでもどうぞ)

Page 19: HiroshimaR6_Introduction

みなさま 今後ともどうぞ

よろしくお願いします

Page 20: HiroshimaR6_Introduction
Page 21: HiroshimaR6_Introduction

2016-02-20 HiRoshima.R #6 @ Hiroshima University

入門者講習

Page 22: HiroshimaR6_Introduction

録音録画自由 著作権等完全放棄

Page 23: HiroshimaR6_Introduction

Tweet Me!

#HiRoshimaR

Page 24: HiroshimaR6_Introduction

Agenda1. R の基本操作 (15) 2. 関数と変数が命 (15) 3. 外部データの読込と作図 (30) 4. RStudio で快適操作 (15) 5. パッケージの利用 (15)

Page 25: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 26: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 27: HiroshimaR6_Introduction

 とは何か• 統計処理を目的とするプログラミング言語

• 無償+オープンソースのソフトウェア

• 作者:Ross Ihaka & Robert Gentleman (R & R) • Ross Ihaka and Robert Gentleman. R: A language for data analysis and graphics.

Journal of Computational and Graphical Statistics, 5(3):299-314, 1996.

• http://biostat.mc.vanderbilt.edu/twiki/pub/Main/JeffreyHorner/JCGSR.pdf

Page 28: HiroshimaR6_Introduction

要するに 統計ソフト

Page 29: HiroshimaR6_Introduction

  の何が良いのか

•無償(IBM SPSS Statistics は約10万円で保守なし...)

•統計処理の種類が豊富

•作図結果が美しい(簡素)

Page 30: HiroshimaR6_Introduction

なぜ今  なのか

• 経費や研究費の節約

• 分析手法の明確化

• 可視化による傾向把握

Page 31: HiroshimaR6_Introduction

 の弱点• 文字入力による操作

• プログラムを組む感覚を養成

• 確実に伝わるという利点も

• 多方面の知識が必要 • 英語+統計+計算機

• 参考書籍がお高め...

Page 32: HiroshimaR6_Introduction

Excel や SPSS は...

•高価(気軽に使えない)

•処理が信頼できず • Excel 使うな(奥村先生@三重大)

•作図結果が美しくない

Page 33: HiroshimaR6_Introduction

  の基本操作 ‐Install / Update / Uninstall‐

Page 34: HiroshimaR6_Introduction

1. http://www.r-project.org/ にアクセス

2. “download R” をクリック

3. JAPAN の中から1つを選ぶ

4. OS に応じたリンクをクリック

  のインストール

Page 35: HiroshimaR6_Introduction

  のインストール

• Windows: : http://cran.ism.ac.jp/bin/windows/base/ •「Download R 3.2.3 for Windows」をクリック

• Mac OS X: http://cran.ism.ac.jp/bin/macosx/ •「R-3.2.3.pkg」をクリック

Page 36: HiroshimaR6_Introduction
Page 37: HiroshimaR6_Introduction
Page 38: HiroshimaR6_Introduction
Page 39: HiroshimaR6_Introduction
Page 40: HiroshimaR6_Introduction
Page 41: HiroshimaR6_Introduction
Page 42: HiroshimaR6_Introduction

  のアップデート1. http://www.r-project.org/ にアクセス

2. 自分が使っているバージョンより新しいものが出ているか確認

3. 新規にインストール用ファイルをダウンロードしてインストール

Page 43: HiroshimaR6_Introduction

  のアップデート• セキュリティ上の問題がない限りは,むやみに更新しない

• パッケージ(付加機能)の動作不良回避

• 新旧の共存は可能 • Windows/Mac: 別名でインストール • ただし何がどう共有されているかは不明

Page 44: HiroshimaR6_Introduction

 のアンインストール• Windows 7/8

• コンパネ→プログラムのアンインストール

• Mac OS X • /Applications にある    アイコンと /Library の中の

Frameworks にある R. framework を削除(CleanApp 可)

Page 45: HiroshimaR6_Introduction

  の起動

• Windows 7/8/10 • START → Program → R → R 3.2.3 を選択

• Mac OS X • /Applications 内の をダブルクリック

Page 46: HiroshimaR6_Introduction

「コンソール」の表示を確認

Page 47: HiroshimaR6_Introduction

  の終了

•コンソールに「q()」と入力 • 今は「作業スペース」は保存しない • ウィンドウが消えれば終了

Page 48: HiroshimaR6_Introduction

  で困ったら...

•まずは Web 検索! • seekR: http://seekr.jp/

• R SEEK: http://www.rseek.org/ • RjpWiki: http://www.okada.jp.org/RWiki/ • R-Tips: http://cse.naro.affrc.go.jp/takezawa/r-tips/r.html

• 標準搭載の help(sth) でも確認可能

Page 49: HiroshimaR6_Introduction

  で困ったら...•参照資料は豊富にあります

• R オンラインガイド(山口大学教育学部教育心理学コース)

• R 言語入門(ドットインストール)

• はじめての「R」(林真広 氏)

• R による統計処理(青木繁伸先生@群馬大学)

• 最近は書籍も増えました

Page 50: HiroshimaR6_Introduction

  概論まとめ

•    は統計ソフト

•無償+何でも統計+美しく作図

•困ったら Web 検索!!

Page 51: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 52: HiroshimaR6_Introduction

 といえば

関数 が命

Page 53: HiroshimaR6_Introduction

関数とは 指定した値に対して 何らかの処理をして 結果を返すもの

Page 54: HiroshimaR6_Introduction

関数(Input を処理)

Input

Output

Page 55: HiroshimaR6_Introduction

sqrt():平方根

•> sqrt(2)

•> sqrt(144)

•> sqrt(104976)

Page 56: HiroshimaR6_Introduction

sqrt 関数

2

1.414214

Page 57: HiroshimaR6_Introduction

「関数(値)」が命

• には多数の関数がある

• q() や help(sth) も関数

• 必要な関数をしつこく実行

Page 58: HiroshimaR6_Introduction

  といえば

変数 も命

Page 59: HiroshimaR6_Introduction

変数とは 1つ以上の値を まとめていれておく「箱」のこと

Page 60: HiroshimaR6_Introduction

では ベクトルとも呼ばれ 複数の値を1つに まとめたものを指す

Page 61: HiroshimaR6_Introduction

統計処理などを行うには 複数の値をまとめて扱う

ことが必要で それを使い回すために

変数を使う

Page 62: HiroshimaR6_Introduction

ちなみに 変数に数値を 入れることを

「代入」といいます

Page 63: HiroshimaR6_Introduction

なにはともあれ 実行してみましょう

Page 64: HiroshimaR6_Introduction

変数の名前は “hako”

•> hako <- c(1,2,3,4,5) •> hako

• c() 関数:combine (cf. https://twitter.com/#!/sakaue/status/193708048030760960) • 値を1つにまとめる関数 • 逆に書いても(一応)OK

Page 65: HiroshimaR6_Introduction

c()関数の “<-” は何?

hako <- c(1,2,3,4,5) の “<-” は

左向きの矢印(←) を表現

(入れ替えても動きます)

Page 66: HiroshimaR6_Introduction

コンソールで「+」が出たら...

• 入力中に誤って[Enter] を押すと,待機状態を示す「+」が出る

• [STOP] ボタンでキャンセル

• [Esc] キーでキャンセル

Page 67: HiroshimaR6_Introduction

履歴機能と補完機能

•履歴: [↑][↓] の矢印キー

•補完: [Tab]キー

Page 68: HiroshimaR6_Introduction

いま “hako” という名前の 「変数」の中に

1から5までの5つの数字が まとめて入っている状態

Page 69: HiroshimaR6_Introduction

では 使い回してみましょう

Page 70: HiroshimaR6_Introduction

以下の関数を実行

•> sqrt(hako)

•> log(hako)

Page 71: HiroshimaR6_Introduction

もし変数がなかったら 何度も関数を

繰り返す羽目になる sqrt(1), sqrt(2) ... sqrt(5) log(1), log (2) ... log (5)

Page 72: HiroshimaR6_Introduction

一括処理のために 変数(ベクトル)の 利用は不可欠

Page 73: HiroshimaR6_Introduction

ここまでのまとめ•   は「関数」と「変数」が命

• 関数を使って数値を処理 • q(), help(), sqrt(), log(), c()

• 変数を使って一括処理!

Page 74: HiroshimaR6_Introduction

覚える必要はなく メモ等を頼りに 実行できれば OK

Page 75: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 76: HiroshimaR6_Introduction

Sub topics

1. 行列のおはなし

2. データフレーム

3. 外部データの読込

Page 77: HiroshimaR6_Introduction

さきほど 一行で表せる数値を 扱いましたが

Page 78: HiroshimaR6_Introduction

実際のデータは 複数行あるはず

Page 79: HiroshimaR6_Introduction

例えば...

•身長と体重

•年齢と年収

•覚えた単語数とTOEIC スコア

Page 80: HiroshimaR6_Introduction

表にすれば...身長 体重

A 180 75B 170 65C 165 60D 175 70E 190 80

Page 81: HiroshimaR6_Introduction

複数の行や列で表されるデータを扱うために

Rでは「行列」を使う

Page 82: HiroshimaR6_Introduction

行列とは

数値が縦横に並べられたもの

Page 83: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 84: HiroshimaR6_Introduction

Page 85: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 86: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 87: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 88: HiroshimaR6_Introduction

Page 89: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 90: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 91: HiroshimaR6_Introduction

1 2 3

4 5 6

7 8 9

Page 92: HiroshimaR6_Introduction

ひとまず 「行列」という存在を 知ってやってください

Page 93: HiroshimaR6_Introduction

行列まとめ

• 横方向が行、縦方向が列

• デフォルトでの数値の並びに注意

• 必要な要素を適宜取り出して値を確認

Page 94: HiroshimaR6_Introduction

Sub topics

1. 行列のおはなし

2. データフレーム

3. 外部データの読込

Page 95: HiroshimaR6_Introduction

データフレームとは

• いろんなデータを突っ込んだもの

• いろんな=質的データ+量的データ

• 突っ込む=一緒に並んでいること

Page 96: HiroshimaR6_Introduction

名前 血液型 身長 体重坂本 B 175 65

高橋 B 177 70

阿部 B 174 75

長野 A 179 70

松本 O 170 60

データフレームとは

Page 97: HiroshimaR6_Introduction

データフレームとは

• Excel の WS とほぼ同じイメージ

• 既存データの読込>自力で作る

• data.frame() 関数が使える

Page 98: HiroshimaR6_Introduction

じゃあ 実際に自力で作るか といったら...

Page 99: HiroshimaR6_Introduction

ああー聞こえないー

http://www.flickr.com/photos/trojanguy/3046207115/“173.365 - Come on, feel the noise” by Jeff the Trojan

Page 100: HiroshimaR6_Introduction

そこで 外部データの読込を行おう

Page 101: HiroshimaR6_Introduction

1. 行列のおはなし

2. データフレーム

3. 外部データの読込

Sub topics

Page 102: HiroshimaR6_Introduction

ここはトラブル多発地域です

うまくいかない時は まず説明をお聴きください

Page 103: HiroshimaR6_Introduction

おそらく...

•Excel でデータ管理

•できればそのまま活かしたい

Page 104: HiroshimaR6_Introduction

作業ディレクトリの設定

•作業ディレクトリとは...

•データを読み込む場所 •データを書き出す場所

Page 105: HiroshimaR6_Introduction

作業ディレクトリの設定• Windows:ファイル → ディレクトリの変更

• “My Documents” にファイル移動

• Mac OS X:環境設定 → 一般(起動)

• ホームディレクトリにファイル移動

• Linux:up to you...

Page 106: HiroshimaR6_Introduction

作業ディレクトリの設定• コンソールからの確認・設定も可能

• getwd()関数:現在の設定を確認

• > getwd()

• setwd()関数:現在の設定を変更 • > setwd("/Users/sakaue/Desktop/") • 実行注意!!

Page 107: HiroshimaR6_Introduction

データの読込 その1

• read.csv() 関数

• CSV 形式のファイルを読み込む

• CSV: Comma Separated Value

Page 108: HiroshimaR6_Introduction

1. hiroshimar.csv を作業ディレクトリへ移動

• XLS/XLSX 形式のものは保存時に変換 • CSV ファイルの文字コードは UTF-8 に

2. > test <- read.csv(choose.files(), header = TRUE) #Win

# test <- read.csv(file.choose(), header = TRUE) #Mac

3. > test [Enter] で中身を確認

データの読込 その1

Page 109: HiroshimaR6_Introduction

CSV 変換なんて面倒... という方に

Page 110: HiroshimaR6_Introduction

データの読込 その2

• read.delim() 関数

• 表形式のデータ読み込む

• delim: delimiter(区切り文字)

Page 111: HiroshimaR6_Introduction

1. hiroshimar.xls を開いてマウスで範囲指定

2. > test2 <- read.delim("clipboard") で代入

3. > test2 [Enter] で中身を確認

データの読込 その2

Mac の場合: read.delim(pipe("pbpaste"))

Page 112: HiroshimaR6_Introduction

読み込んだら関数で処理

> table(test[,3]) •度数分布を確認する

> mean(test[,3]) •平均値を求める

3列目対象

3列目対象

Page 113: HiroshimaR6_Introduction

外部データの読込

• 作業ディレクトリの設定に注意

• CSV 形式に変換後,read.csv()関数で読込

• 必要な行 or 列を指定して処理

Page 114: HiroshimaR6_Introduction

http://www.flickr.com/photos/rosengrant/4751386872/

CSV 形式にして 読み込めば

重たいExcelファイルに おさらば!

“y2.d175 | Lasershow! Relax!” by B Rosen

Page 115: HiroshimaR6_Introduction

データを集めたら 数値要約だけでなく データの可視化も必要

Page 116: HiroshimaR6_Introduction

というわけで 作図のお時間です

Page 117: HiroshimaR6_Introduction

基本的な作図手順

1. 変数に値を代入

2. 作図用の関数で処理

Page 118: HiroshimaR6_Introduction

たった2段階 Excel や SPSS ではこうはいかない

Page 119: HiroshimaR6_Introduction

基本的な作図手順

1. 変数に値を代入する

2. 作図用の関数を実行

Page 120: HiroshimaR6_Introduction

• ヒストグラム

• 散布図

• 棒グラフ

• 折れ線グラフ

• 箱ひげ図

作成できる図の種類

Page 121: HiroshimaR6_Introduction

まずはヒストグラム

【事例】 得点のヒストグラムを

作成する

Page 122: HiroshimaR6_Introduction

まずはヒストグラム

> pretest <- (test$Pre) > hist(pretest)

Page 123: HiroshimaR6_Introduction

次は散布図【事例】

事前テストの得点と 事後テストの得点を 比較し,伸びを見る

Page 124: HiroshimaR6_Introduction

続いて散布図> pretest <- (test$Pre) > posttest <- (test$Post) > plot(pretest, posttest) > plot(pretest,posttest, ylim=c(0,100),xlim=c(0,100))

Page 125: HiroshimaR6_Introduction

続いて箱ひげ図【事例】

事前テストの得点と 事後テストの得点の <幅>を比較する

Page 126: HiroshimaR6_Introduction

続いて箱ひげ図

> pretest <- (test$Pre) > posttest <- (test$Post) > boxplot(pretest, posttest, names=c("PRE", "POST"))

Page 127: HiroshimaR6_Introduction

箱ひげ図

> boxplot(pretest, posttest, names=c("Pre", "Post"), horizontal=T)

Page 128: HiroshimaR6_Introduction

箱ひげ図

> boxplot(pretest, posttest, names=c("Pre", "Post"), horizontal=T, ylim=c(0,100))

Page 129: HiroshimaR6_Introduction

箱ひげ図

> boxplot(pretest, posttest, names=c("Pre", "Post"), horizontal=T, ylim=c(0,100), col="blue")

Page 130: HiroshimaR6_Introduction

箱ひげ図

> boxplot(pretest, posttest, names=c("Pre", "Post"), horizontal=T, ylim=c(0,100), col="blue", xlab="SCORE", ylab="TEST", main="BOXPLOT")

Page 131: HiroshimaR6_Introduction

作図手順のまとめ1. 変数に値を代入する

2. 作図用の関数を使って処理する

3. 形式を指定して保存

+人に伝承(twitter, FB)

Page 132: HiroshimaR6_Introduction

http://www.flickr.com/photos/rosengrant/4751386872/

手軽に美しく 作図できる    を 使えるようになれば Excel におさらば!

“y2.d175 | Lasershow! Relax!” by B Rosen

Page 133: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 134: HiroshimaR6_Introduction

RStudioとは?

• R を快適に使うための統合開発環境 (IDE)

• ひとつの画面に複数の情報を配置

• 面倒(そう)なことがすぐできて(・∀・)イイ!! • 関数等の入力支援(tab)

• 変数等の中身をすぐに確認(CLICK!)

• Markdown によるレポート作成(割愛…)

Page 135: HiroshimaR6_Introduction

RStudio のインストール

(R そのものは事前のインストールが必要)

Page 136: HiroshimaR6_Introduction

RStudio のインストール

Page 137: HiroshimaR6_Introduction

RStudio のインストール

Page 138: HiroshimaR6_Introduction

↓OS に応じてダウンロード

RStudio のインストール

Page 139: HiroshimaR6_Introduction

コンソール

エディタ 変数・履歴

いろいろ

RStudio の起動直後

Page 140: HiroshimaR6_Introduction

画面 できること

エディタ(左上) 関数などの入力・既存スクリプトを閲覧 Run でそのまま実行も可

コンソール(左下) 関数の実行・変数への代入など 素の R と同じ

変数・履歴(右上) 変数の中身や使用した関数を表示 ダブルクリックでコンソールに貼付

いろいろ(右下)ファイルの一覧表示 作図結果の表示 パッケージ管理

ひとつの画面ですべてのことを

Page 141: HiroshimaR6_Introduction

なにはともあれ Project を作成

↓New Directory を選択

Page 142: HiroshimaR6_Introduction

なにはともあれ Project を作成

↓Empty Project を選択

Page 143: HiroshimaR6_Introduction

なにはともあれ Project を作成↓Directory name を入力し

その名をつけた Directoryをどこに作るか選択

Page 144: HiroshimaR6_Introduction

ちなみに配置は変更可能Tools -> Global Options にある

Pane Layout で配置は変更可能

Page 145: HiroshimaR6_Introduction

画面 できること

エディタ(左上) 関数などの入力・既存スクリプトを閲覧 Run でそのまま実行も可

コンソール(左下) 関数の実行・変数への代入など 素の R と同じ

変数・履歴(右上) 変数の中身や使用した関数を表示 ダブルクリックでコンソールに貼付

いろいろ(右下)ファイルの一覧表示 作図結果の表示 パッケージ管理

ひとつの画面ですべてのことを

Page 146: HiroshimaR6_Introduction

http://www.slideshare.net/TakashiYamane1/rstudio

時間がないので 山根さんの資料を見ましょう

(HiRoshima.R #2 での資料。47K views!)

改訂版は Hijiyama.R #3 にてhttp://www.slideshare.net/TakashiYamane1/rrstudio

Page 147: HiroshimaR6_Introduction

いろいろと手助けしてくれる

RStudio を使って

R に慣れていきましょう

Page 148: HiroshimaR6_Introduction

Agenda1. R の基本操作 2. 関数と変数が命 3. 外部データの読込と作図 4. RStudio で快適操作 5. パッケージの利用

Page 149: HiroshimaR6_Introduction

Packageとは?

• ある処理・機能に特化したプログラム

• base(基本パッケージ)だけでも 1,000 以上

• 特殊な処理を行う際は,別の package を追加

• 言語処理に特化したものもある(ex. RMeCab)

Page 150: HiroshimaR6_Introduction

可視化の発展編

violin plot と beeswarm

―分布をより分かりやすく捉えるために―

Page 151: HiroshimaR6_Introduction

violin plot ≒ boxplot+hist

> install.packages("vioplot") > library("vioplot")

> vioplot(pretest,posttest, names=c("Pre","Post"))

Page 152: HiroshimaR6_Introduction
Page 153: HiroshimaR6_Introduction

boxplot + beeswarm

> install.packages("beeswarm") > library("beeswarm") > PrePost <- test[,c("Pre", “Post")] > boxplot(pretest, posttest, names=c("PRE", "POST"))

> beeswarm(PrePost, add=TRUE)

Page 154: HiroshimaR6_Introduction
Page 155: HiroshimaR6_Introduction

おわりに

Page 156: HiroshimaR6_Introduction

のススメ

Page 157: HiroshimaR6_Introduction

• すべての処理・分析が R のみで完結 • <-> Editor + Excel (+ UNIX) + R + なんやかんや

• プログラミングの基礎養成に有効

• --> Python, Perl, ... どこでも使える

• 作図が美しい(+Mac ならフォントも)

• Excel の作図は一般に (‘A`)ヴァ-

のススメ

Page 158: HiroshimaR6_Introduction

• データの取り扱い方に用心する • Excel に任せっきりとしない

• データの処理過程をはっきりさせる • Excel に任せっきりにしない

• データの分布をよく観察する • Excel に任せっきりにしない

のススメ

Page 159: HiroshimaR6_Introduction

参考文献

Page 160: HiroshimaR6_Introduction

参考文献(続)

Page 161: HiroshimaR6_Introduction

Enjoy !twitter: @sakaue

e-mail: tsakaue<AT>hiroshima-u.ac.jp