Submit Search
Upload
Rgraphics
•
0 likes
•
675 views
Hiroaki Suzuki
Follow
おそらく学部4年時代に3年生向けにでっちあげたRの資料。
Read less
Read more
Education
Report
Share
Report
Share
1 of 24
Download now
Download to read offline
Recommended
Community dynamics of the adolescent vaginal microbiome during puberty (UOreg...
Community dynamics of the adolescent vaginal microbiome during puberty (UOreg...
Roxana Hickey
Advanced Procedural Rendering in DirectX11 - CEDEC 2012
Advanced Procedural Rendering in DirectX11 - CEDEC 2012
smashflt
主成分分析(Pca)
主成分分析(Pca)
Shushi Namba
Barley environmental association - Plant & Animal Genome 2018
Barley environmental association - Plant & Animal Genome 2018
PeterMorrell4
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
Allen Day, PhD
Fairisle knitting
Fairisle knitting
zafiro555
正誤表 p39
正誤表 p39
zafiro555
Optimal Nudging. Presentation UD.
Optimal Nudging. Presentation UD.
r-uribe
Recommended
Community dynamics of the adolescent vaginal microbiome during puberty (UOreg...
Community dynamics of the adolescent vaginal microbiome during puberty (UOreg...
Roxana Hickey
Advanced Procedural Rendering in DirectX11 - CEDEC 2012
Advanced Procedural Rendering in DirectX11 - CEDEC 2012
smashflt
主成分分析(Pca)
主成分分析(Pca)
Shushi Namba
Barley environmental association - Plant & Animal Genome 2018
Barley environmental association - Plant & Animal Genome 2018
PeterMorrell4
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
Allen Day, PhD
Fairisle knitting
Fairisle knitting
zafiro555
正誤表 p39
正誤表 p39
zafiro555
Optimal Nudging. Presentation UD.
Optimal Nudging. Presentation UD.
r-uribe
Deep dive into Nagios analytics
Deep dive into Nagios analytics
Datadog
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
questRCN
Fruit breedomics workshop wp6 application of high throughput micheletti
Fruit breedomics workshop wp6 application of high throughput micheletti
fruitbreedomics
Spray Democamp Dresden 2011-11-08
Spray Democamp Dresden 2011-11-08
joergreichert
17 polishing
17 polishing
Hadley Wickham
Pocket dot grid pages
Pocket dot grid pages
HIKOO
アイ・トレーニング10点)
アイ・トレーニング10点)
kenji sakuma
14 case-study
14 case-study
Hadley Wickham
Entwicklungen in Spielen als Innovationstreiber für Usability
Entwicklungen in Spielen als Innovationstreiber für Usability
Michael Jendryschik
Entwicklung in Spielen als Innovationstreiber für Usability
Entwicklung in Spielen als Innovationstreiber für Usability
itemis AG
Unit Testing Tool Competition-Eighth Round
Unit Testing Tool Competition-Eighth Round
Sebastiano Panichella
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
itemis AG
Modernisierung von Altanwendungen
Modernisierung von Altanwendungen
itemis AG
How Outdoor Lighting damages the Environment
How Outdoor Lighting damages the Environment
Christian Reinboth
Model Visualisation (with ggplot2)
Model Visualisation (with ggplot2)
Hadley Wickham
The Ecology of Forage Fish in the Salish Sea
The Ecology of Forage Fish in the Salish Sea
Tessa Francis
データ社会を生きる技術〜人工知能のHypeとHope〜
データ社会を生きる技術〜人工知能のHypeとHope〜
Ichigaku Takigawa
Innovation & Issue process
Innovation & Issue process
Katsuhito Okada
Modul mulus bahagian c sjk (modul guru)
Modul mulus bahagian c sjk (modul guru)
Anparasu
YAKINDU Traceability
YAKINDU Traceability
itemis AG
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
TechSoup
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
navabharathschool99
More Related Content
Similar to Rgraphics
Deep dive into Nagios analytics
Deep dive into Nagios analytics
Datadog
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
questRCN
Fruit breedomics workshop wp6 application of high throughput micheletti
Fruit breedomics workshop wp6 application of high throughput micheletti
fruitbreedomics
Spray Democamp Dresden 2011-11-08
Spray Democamp Dresden 2011-11-08
joergreichert
17 polishing
17 polishing
Hadley Wickham
Pocket dot grid pages
Pocket dot grid pages
HIKOO
アイ・トレーニング10点)
アイ・トレーニング10点)
kenji sakuma
14 case-study
14 case-study
Hadley Wickham
Entwicklungen in Spielen als Innovationstreiber für Usability
Entwicklungen in Spielen als Innovationstreiber für Usability
Michael Jendryschik
Entwicklung in Spielen als Innovationstreiber für Usability
Entwicklung in Spielen als Innovationstreiber für Usability
itemis AG
Unit Testing Tool Competition-Eighth Round
Unit Testing Tool Competition-Eighth Round
Sebastiano Panichella
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
itemis AG
Modernisierung von Altanwendungen
Modernisierung von Altanwendungen
itemis AG
How Outdoor Lighting damages the Environment
How Outdoor Lighting damages the Environment
Christian Reinboth
Model Visualisation (with ggplot2)
Model Visualisation (with ggplot2)
Hadley Wickham
The Ecology of Forage Fish in the Salish Sea
The Ecology of Forage Fish in the Salish Sea
Tessa Francis
データ社会を生きる技術〜人工知能のHypeとHope〜
データ社会を生きる技術〜人工知能のHypeとHope〜
Ichigaku Takigawa
Innovation & Issue process
Innovation & Issue process
Katsuhito Okada
Modul mulus bahagian c sjk (modul guru)
Modul mulus bahagian c sjk (modul guru)
Anparasu
YAKINDU Traceability
YAKINDU Traceability
itemis AG
Similar to Rgraphics
(20)
Deep dive into Nagios analytics
Deep dive into Nagios analytics
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
Aiello-Lammens: Global Sensitivity Analysis for Impact Assessments.
Fruit breedomics workshop wp6 application of high throughput micheletti
Fruit breedomics workshop wp6 application of high throughput micheletti
Spray Democamp Dresden 2011-11-08
Spray Democamp Dresden 2011-11-08
17 polishing
17 polishing
Pocket dot grid pages
Pocket dot grid pages
アイ・トレーニング10点)
アイ・トレーニング10点)
14 case-study
14 case-study
Entwicklungen in Spielen als Innovationstreiber für Usability
Entwicklungen in Spielen als Innovationstreiber für Usability
Entwicklung in Spielen als Innovationstreiber für Usability
Entwicklung in Spielen als Innovationstreiber für Usability
Unit Testing Tool Competition-Eighth Round
Unit Testing Tool Competition-Eighth Round
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
Gemeinsam kreativ für bessere Software - Vortragsreihe Dortmund
Modernisierung von Altanwendungen
Modernisierung von Altanwendungen
How Outdoor Lighting damages the Environment
How Outdoor Lighting damages the Environment
Model Visualisation (with ggplot2)
Model Visualisation (with ggplot2)
The Ecology of Forage Fish in the Salish Sea
The Ecology of Forage Fish in the Salish Sea
データ社会を生きる技術〜人工知能のHypeとHope〜
データ社会を生きる技術〜人工知能のHypeとHope〜
Innovation & Issue process
Innovation & Issue process
Modul mulus bahagian c sjk (modul guru)
Modul mulus bahagian c sjk (modul guru)
YAKINDU Traceability
YAKINDU Traceability
Recently uploaded
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
TechSoup
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
navabharathschool99
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
Mark Reed
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
Celine George
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
nelietumpap1
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
9953056974 Low Rate Call Girls In Saket, Delhi NCR
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
phamnguyenenglishnb
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
SherlyMaeNeri
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Celine George
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
Celine George
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
AshokKarra1
Visit to a blind student's school🧑🦯🧑🦯(community medicine)
Visit to a blind student's school🧑🦯🧑🦯(community medicine)
lakshayb543
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
MIPLM
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Celine George
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
Sabitha Banu
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
KayeClaireEstoconing
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
JoshuaGantuangco2
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
ChelloAnnAsuncion2
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
Nguyen Thanh Tu Collection
Recently uploaded
(20)
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
Visit to a blind student's school🧑🦯🧑🦯(community medicine)
Visit to a blind student's school🧑🦯🧑🦯(community medicine)
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
Rgraphics
1.
R graphics ∼programingⅣ∼ 2012/12/12 1
2.
Demo demo()を使ってみよう! 対話環境で > demo(graphics) graphics 伝統的なトレリスグラフィックス image
画像に関するデモ plotmath 数式描写のデモ 2
3.
3
4.
x Density 0.0 0.1 0.2 0.3 −2 0 2 ●
● ● ● ●● ●● ●● ● ● ●● ●● ●●● ● ● ● ●●●● ● ● ● ● ●●● ● ●● ●● ● ● ● ● ●●● ●● ● ●● ● ● ●● ●●●● ●●● ● ●● ●●●● ● ● ● ● ● ●● ● ● ●●● ● ● ● ● ●●● ●● ●● ● ●● ● ●●● ●●● ●●● ● ● ●● ●● ● ● ● ● ● ● ●● ● ●● ● ●● ●●● ●● ● ● ●●● ● ● ●● ●● ●●●●●● ● ● ● ● ●● ●●● ● ● ● ●●● ● ● ● ●● ●● ●●●●● ● ● ● ● ● ● ● ● ●●●●●● ●● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ●●● ●● ●●● ●● ● ● ● ●● ●● ● ● ●●● ●●● ● ● ● ●●● ●● ●● ●●● ● ● ●● ●●● ● ●● ●●● ● ● ● ●●● ● ● ● ●●● ●●● ● ● ●● ●● ●● ●●● ●●● ● ●● ●● ●●● ● ●●● ● ●● ● ● ● ●● ● ●●● ● ● ●●● ● ●● ●●● ● ●● ●● ● ● ● ● ● ●● ● ●● ●●●● ●● ● ● ● ●●● ●●● ●● ●●● ●● ● ●●●● ●● ● ● ● ●● ●● ●● ●● ● ●● ● ●● ● ●●● ● ● ● ●● ●● ● ●● ●● ● ● ● ●● ●●● ● ●● ● ● ● ●● ● ●●● ● ●● ●● ● ●●● ● ●● ●● ● ● ●● ● ● ● ● ● ● ●●● ● ●●● ●● ● ●● ● ● ●● ●●● ●● ● ● ●●●● ● ● ● ●●● ●● ●● ●●● ●● ● ●● ●● ● ● ● ●●● ● ● ●● ●● ● 3
5.
x Density 0.0 0.1 0.2 0.3 −2 0 2 ●
● ● ● ●● ●● ●● ● ● ●● ●● ●●● ● ● ● ●●●● ● ● ● ● ●●● ● ●● ●● ● ● ● ● ●●● ●● ● ●● ● ● ●● ●●●● ●●● ● ●● ●●●● ● ● ● ● ● ●● ● ● ●●● ● ● ● ● ●●● ●● ●● ● ●● ● ●●● ●●● ●●● ● ● ●● ●● ● ● ● ● ● ● ●● ● ●● ● ●● ●●● ●● ● ● ●●● ● ● ●● ●● ●●●●●● ● ● ● ● ●● ●●● ● ● ● ●●● ● ● ● ●● ●● ●●●●● ● ● ● ● ● ● ● ● ●●●●●● ●● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ●●● ●● ●●● ●● ● ● ● ●● ●● ● ● ●●● ●●● ● ● ● ●●● ●● ●● ●●● ● ● ●● ●●● ● ●● ●●● ● ● ● ●●● ● ● ● ●●● ●●● ● ● ●● ●● ●● ●●● ●●● ● ●● ●● ●●● ● ●●● ● ●● ● ● ● ●● ● ●●● ● ● ●●● ● ●● ●●● ● ●● ●● ● ● ● ● ● ●● ● ●● ●●●● ●● ● ● ● ●●● ●●● ●● ●●● ●● ● ●●●● ●● ● ● ● ●● ●● ●● ●● ● ●● ● ●● ● ●●● ● ● ● ●● ●● ● ●● ●● ● ● ● ●● ●●● ● ●● ● ● ● ●● ● ●●● ● ●● ●● ● ●●● ● ●● ●● ● ● ●● ● ● ● ● ● ● ●●● ● ●●● ●● ● ●● ● ● ●● ●●● ●● ● ● ●●●● ● ● ● ●●● ●● ●● ●●● ●● ● ●● ●● ● ● ● ●●● ● ● ●● ●● ● xx yy zzz 3
6.
x Density 0.0 0.1 0.2 0.3 −2 0 2 ●
● ● ● ●● ●● ●● ● ● ●● ●● ●●● ● ● ● ●●●● ● ● ● ● ●●● ● ●● ●● ● ● ● ● ●●● ●● ● ●● ● ● ●● ●●●● ●●● ● ●● ●●●● ● ● ● ● ● ●● ● ● ●●● ● ● ● ● ●●● ●● ●● ● ●● ● ●●● ●●● ●●● ● ● ●● ●● ● ● ● ● ● ● ●● ● ●● ● ●● ●●● ●● ● ● ●●● ● ● ●● ●● ●●●●●● ● ● ● ● ●● ●●● ● ● ● ●●● ● ● ● ●● ●● ●●●●● ● ● ● ● ● ● ● ● ●●●●●● ●● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ●●● ●● ●●● ●● ● ● ● ●● ●● ● ● ●●● ●●● ● ● ● ●●● ●● ●● ●●● ● ● ●● ●●● ● ●● ●●● ● ● ● ●●● ● ● ● ●●● ●●● ● ● ●● ●● ●● ●●● ●●● ● ●● ●● ●●● ● ●●● ● ●● ● ● ● ●● ● ●●● ● ● ●●● ● ●● ●●● ● ●● ●● ● ● ● ● ● ●● ● ●● ●●●● ●● ● ● ● ●●● ●●● ●● ●●● ●● ● ●●●● ●● ● ● ● ●● ●● ●● ●● ● ●● ● ●● ● ●●● ● ● ● ●● ●● ● ●● ●● ● ● ● ●● ●●● ● ●● ● ● ● ●● ● ●●● ● ●● ●● ● ●●● ● ●● ●● ● ● ●● ● ● ● ● ● ● ●●● ● ●●● ●● ● ●● ● ● ●● ●●● ●● ● ● ●●●● ● ● ● ●●● ●● ●● ●●● ●● ● ●● ●● ● ● ● ●●● ● ● ●● ●● ● xx yy zzz 5 10 15 20 25 30 35 40 5 10 15 20 5 10 15 20 3
7.
Graphics Device OSや画像によっていろいろ ここに描写 4
8.
作図関数 高水準作図関数 低水準作図関数 hist() : ヒストグラム plot()
: 散布図 barplot() : 棒グラフ text() : 座標にラベルを描写 title() : タイトルを描写 5
9.
作図の流れ 高水準作図関数で図形を描写 低水準作図関数で文字などを追加 *大抵オプションでできる........... 6
10.
ヒストグラム hist() > hist(iris$Sepal.Length) irisデータのSepal.Lengthを使って ヒストグラムを作成 >
str(iris) irisのデータ構造を表示させる 7
11.
少し頑張ったヒストグラム > hist(iris[iris$Species=="setosa",]$Sepal.Length, # SpeciesがsetosaのSepal.Lengthを使う col="blue",
# 色は青 main="setosa", # タイトルはsetosa xlim=range(iris$Sepal.Length), # x軸はSepal.Lengthの範囲 xlab="Sepal.Length") # x軸のラベル 8
12.
散布図 plot() > plot(iris[,1],iris[,3]) #plot(x軸のデータ、y軸のデータ) 第1変数Sepal.Lengthと 第3変数Petal.Lengthの散布図 9
13.
plot()の形式 1 > plot(iris[,1],
type=”s”) plot(数値ベクトル,オプション) 2 > plot(iris[,1], iris[,2], type=”n”) plot(数値ベクトル1,数値ベクトル2,オプション) 3 > plot(matrix(1:12, nrow=6, ncol=2),type="l") plot(行列, オプション) 4 > plot(iris, main="iris Data") plot(データフレーム, オプション) 10
14.
低水準作図関数をつかってみる > plot(iris[,1],iris[,3],type="n") # type=”n”
軸以外なにも描かない > text(iris[,1],iris[,3]) # サンプル番号の散布図を作成 11
15.
描画オプション type プロットの形式 “p”(点)
“l”(直線)...... col 色の指定 “red”,”blue”......... main メインタイトルの指定 “Apple” sub サブタイトルの指定 “2012/12/5” x(y)lab x(y)軸のタイトルの指定 “time” 他にもいろいろ 12
16.
図の保存 > pdf(file="test.pdf", width=6,
height=4) # Graphic Deviceをオープン > plot(iris[,2], type="l", main="TestGraphics") # 図を描写 > dev.off() # Graphic Deviceをクローズ ワーキングディレクトリに保存される 必ず! 13
17.
出力方法 pdf() pdf形式 pictex() texで使える形式 jpeg()
jpeg形式 png() png形式 bitmap() ビットマップ形式 14
18.
k-menasの結果表示 15 > data(iris) > mi
<- iris[1:4] > ans <- iris[5] > km <- kmeans(mi,3,20) > plot(iris[,1],iris[,2], col=km$cluster) データ番号に色を自動で割り振ってくれる
19.
16 ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 2.02.53.03.54.0 iris[, 1] iris[,2]
20.
主成分分析 主成分分析 prcomp > data(iris) >
data <- iris[1:4] > prcomp.obj <- prcomp(data,scale=TRUE) > pc1 <- prcomp.obj$x[,1] > pc2 <- prcomp.obj$x[,2] 主成分分析 : 次元が多くてグラフの描けないようなデータを 2次元など低次元に要約 #irisの1-4列のデータを使用 # 第一主成分得点 # 第二主成分得点 17
21.
分析結果の表示 plotを使って作図 > label <-
iris[,5] > plot(pc1, pc2, col = label, main = "result") # 3種類のラベルに色を割り振って作図 ★おまけ biplot(prcomp.obj)でも作図できます 18
22.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● −3 −2 −1 0 1 2 3 −2−1012 result pc1 pc2 19
23.
20 coution dev.off()したら図が出なくなった 色 • Graphic Deviceを開いてからplot
→ x11() •Rを起動しなおす • クラスタ数が多すぎると色が足りないかも
24.
参考資料 R-Tips http://cse.naro.affrc.go.jp/takezawa/r-tips/r.html プログラミングR 「基礎からグラフィックスまで」 統計科学研究所HP http://www.statistics.co.jp/ 21
Download now