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
680
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
510
R & R Studio
hujuu
4
590
Other Decks in Education
See All in Education
Kindleストアで本を探すことの善悪 #Izumo Developers' Guild 第1回 LT大会
totodo713
0
150
Design Guidelines and Models - Lecture 5 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
720
1127
cbtlibrary
0
170
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
signer
PRO
1
2.5k
地図を活用した関西シビックテック事例紹介
barsaka2
0
100
1106
cbtlibrary
0
430
Adobe Analytics入門講座【株式会社ニジボックス】
nbkouhou
0
23k
Introduction - Lecture 1 - Web Technologies (1019888BNR)
signer
PRO
0
4.9k
BrightonSEO, San Diego, CA 2024
mchowning
0
100
お仕事図鑑pitchトーク
tetsuyaooooo
0
2.3k
脳卒中になってしまった さあ、どうする
japanstrokeassociation
0
1.1k
ThingLink
matleenalaakso
28
3.8k
Featured
See All Featured
A better future with KSS
kneath
238
17k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
Optimizing for Happiness
mojombo
376
70k
Statistics for Hackers
jakevdp
796
220k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Designing for humans not robots
tammielis
250
25k
Raft: Consensus for Rubyists
vanstee
137
6.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Producing Creativity
orderedlist
PRO
341
39k
How STYLIGHT went responsive
nonsquared
95
5.2k
Agile that works and the tools we love
rasmusluckow
328
21k
Why Our Code Smells
bkeepers
PRO
335
57k
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