Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
R&RStudio入門
Search
hujuu
November 19, 2016
Education
0
670
R&RStudio入門
<Rのインストールから簡単な操作を実践>
~ Rの概要と使い方を学びます ~
・RとR studioの紹介と使い方
・ベーシックなスクリプトを書いてみる
・CSVを読み込んで分析の準備をしよう
hujuu
November 19, 2016
Tweet
Share
More Decks by hujuu
See All by hujuu
ggplot2の導入とヒストグラム作成
hujuu
0
500
R & R Studio
hujuu
4
580
Other Decks in Education
See All in Education
Lisätty todellisuus opetuksessa
matleenalaakso
1
2.3k
不登校予防・再登校支援プログラムを提供するToCo (トーコ) の会社紹介資料 toco.mom
toco3week
0
410
Chapitre_1_-__L_atmosphère_et_la_vie_-_Partie_1.pdf
bernhardsvt
0
220
謙虚なアジャイルコーチ__アダプティブ_ムーブ_による伴走支援.pdf
antmiyabin
0
270
老人会? いえ、技術継承です @ builderscon 2024 LT
s3i7h
0
110
ACT FAST 20240830
japanstrokeassociation
0
320
Repaso electricidade e electrónica
irocho
0
200
Nodiレクチャー 「CGと数学」講義資料 2024/11/19
masatatsu
2
190
Ch2_-_Partie_2.pdf
bernhardsvt
0
110
Semantic Web and Web 3.0 - Lecture 9 - Web Technologies (1019888BNR)
signer
PRO
1
2.5k
【COPILOT無料セミナー】エンゲージメントと自律性の高いプロジェクト型人材育成に向けて~プロジェクト・ベースド・ラーニング(PBL)という選択肢~
copilot
PRO
0
130
Adobe Express
matleenalaakso
1
7.5k
Featured
See All Featured
Designing for Performance
lara
604
68k
Become a Pro
speakerdeck
PRO
25
5k
Optimizing for Happiness
mojombo
376
70k
Agile that works and the tools we love
rasmusluckow
327
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Ruby is Unlike a Banana
tanoku
97
11k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Happy Clients
brianwarren
98
6.7k
Transcript
R & R STUDIO TUTORIAL R BUSINESS ANALYSIS Wi-Fi SSID:
Pass:
R Business Analysis ͻͱ·ͣࣗݾհ • ήʔϜ։ൃͯ͠·͢ • ࠷ۙओʹQA • R
ྺ • 1 • ౘ • ͋Θͤͯɺߚ • స৬૬ஊडத!! @hujuu
R Business Analysis ࣮ʹ׆͖ΔܗͰRΛֶͿ • ৗۀͰσʔλੳΛ͍ͯ͠Δ͕ɺֶͼ͋͏ڥ ͕ͳ͘ࠔ͍ͬͯΔ • σʔλੳπʔϧͱͯ͠,ʮ R
ʯΛݕ౼͍ͯ͠Δ • ઐੑϓϩάϥϛϯάεΩϧʹدͬͨษڧձͰ ͳ࣮͘ʹ݁͢ΔσʔλੳྗΛߴΊ͍ͨ
R Business Analysis RͲΜͳݴޠʁ ౷ܭղੳ͚ͷϓϩάϥϛϯάݴޠ ୭Ͱ͑Δʂ ແྉͰ Windows ʹ Mac
ʹରԠ ͍ͭͰ͑Δ গͳ͍ίʔυͰੳ݁ՌάϥϑΛૉૣ͘ग़ྗ 4
R Business Analysis • ॲཧ͕༏Ε͓ͯΓɺϏοάσʔλΛੳ͢Δࡍʹޮత • ExcelͰΉ͔͍ͣ͠౷ܭੳ͕ग़དྷΔ • ྫ :
Ϋϥελʔੳ, όεέοτੳ(ΞιγΤʔγϣϯੳ) • ༷ʑͳύοέʔδΛ׆༻͢Δ͜ͱͰੳͷ෯͕͛ΒΕΔ • άϥϑͷඳըʹڧ͍ • ggplot2ͰͷάϥϑԽࣗ༝͕ߴ͘ɺࢹೝੑ͕ߴ͍ ɹɹɹͷओͳϝϦοτ
R Business Analysis ൺֱ༰ OS Mac,Windows,Linux WindowsϝΠϯ Macͩͱੳػೳ͕ෆࣗ༝ ॲཧ ˚
X ѻ͑Δσʔλྔ ʓ (150ສߦͷಡΈࠐΈՄೳ) X (1,048,576 ߦɺ16,384 ྻ) ֦ுੑ ʓ ˚ GUI ˚ ʓ Ձ֨ ແྉ ༗ྉʢ݄ઍԁʙʣ ར༻༻్ ౷ܭղੳ දܭࢉࢿྉ࡞ͳͲଟ༷
R Business Analysis ɹɹɹͷΠϯετʔϧ 1. CRANʢThe Comprehensive R Archive NetworkʣʹΞ
Ϋηε https://cran.r-project.org/ 2. ༻͍ͯ͠ΔOSʹ͋ΘͤͯRͷΠϯετʔϥʔΛμϯ ϩʔυ ύοέʔδ͕ಈ͔ͳ͍͜ͱ͕ແ͍Α͏ʹ࠷৽൛Λ 3. μϯϩʔυͨ͠ϑΝΠϧΛ։͍ͯΠϯετʔϧ
R Business Analysis
R Business Analysis αϯϓϧίʔυ 2 ^ 5 a <- 100
b <- 2 a * b list <- c(2,4,6,8,10) list
R Business Analysis ͷΠϯετʔϧ 1. ͍ΘΏΔ RͷIDE (౷߹։ൃڥ)Ͱ͢ɻ εΫϦϓτϑΝΠϧɺ࣮ߦconsoleɺάϥϑεϖʔεɺ ಡΈࠐΜͩσʔλͷҰཡͳͲ͕ݟ͘͢ஔ͞Ε·͢
2. R studioͷΠϯετʔϥΛμϯϩʔυ https://www.rstudio.com/products/rstudio/download/ 3. μϯϩʔυͨ͠ΠϯετʔϥΛ։͍ͯΠϯετʔϧ
R Business Analysis
R Business Analysis • ೖྗิॿ͕ڧ͍ • άϥϑͷΞτϓοτ͕͍͢͠ • ΤσΟλͷจࣈ৭ͱഎܠΛฤू͠ ͯɺݟ͍͢ઃఆʹͰ͖Δ
• ෳͷεΫϦϓτϑΝΠϧΛλϒͰ ։͍͓͚ͯΔ • ύοέʔδϦετͷӾཡσΟϨΫ τϦϑΝΠϧͷ֬ೝͳͲ͕Ͱ͖Δ ͷϝϦοτ
R Business Analysis άϥϑΛॻ͍ͯΈΑ͏ʂ x <- 1:10 y <- 1:10
plot(x, y) # x࣠Λ10͔Β1ͷฒͼํʹ͢Δ plot(x, y, xlim=c(10,1))
R Business Analysis ࡞ۀσΟϨΫτʹ͍ͭͯ • σʔλϓϩάϥϜͷ ಡΈࠐΈ,σʔλͷॻ͖ ग़͠Λ͢Δॴ͕࡞ۀ σΟϨΫτϦ •
ϑΝΠϧࢦఆ͕͍͢͠ Α͏ʹมߋ͓ͯ͘͠
R Business Analysis CSVσʔλΛಡΈࠐΜͰΈΑ͏ʂ # ࡞ۀσΟϨΫτϦʹ͋ΔCSVΛಡΈऔΔ read.csv("kakei_201609.csv") # ࡞ۀσΟϨΫτϦʹ͋ΔCSVΛಡΈࠐΉ data
<- read.csv("kakei_201609.csv") # ಡΈࠐΜͩσʔλςʔϒϧͷ಄Λදࣔ head(data)
R Business Analysis جຊతͳؔΛͬͯΈΑ͏ʂ # σʔλϑϨʔϜͷฏۉɺதԝͳͲΛ·ͱΊͯग़͢ summary(data) # ྻΛࢦఆͯ͠ɺαϚϦʔΛදࣔ͢Δ summary(data$ফඅࢧग़)
# ಡΈࠐΜͩσʔλςʔϒϧͷྻ໊Λදࣔ names(data)
R Business Analysis ͞Βʹ…Α͘͏ศརͳؔҰཡ ؔ max(x) min(x) mean(x) median(x) sum(x)
ҙຯ ࠷େ ࠷খ ฏۉ தԝ ૯
R Business Analysis άϥϑΛॻ͍ͯΈΑ͏ʂ # άϥϑͰຊޠΛදࣔ͢Δઃఆ par(family = "HiraKakuProN-W3") #
ฏۉάϥϑΛඳը͢Δ barplot(data$ڭཆޘָ, names.arg = data$༻్ྨ, las = 3)
R Business Analysis E N D