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
アニメに学ぶチームの多様性とコンピテンシー
terahide
0
210
JavaScript - Lecture 6 - Web Technologies (1019888BNR)
signer
PRO
0
2.5k
H5P-työkalut
matleenalaakso
4
35k
"数学" をプログラミングしてもらう際に気をつけていること / Key Considerations When Programming "Mathematics"
guvalif
0
540
The Blockchain Game
jscottmo
0
3.6k
Medicare 101 for 2025
robinlee
PRO
0
150
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
signer
PRO
1
2.4k
cbt2324
cbtlibrary
0
110
プロダクト・エンジニア・QAE 3軸でのナレッジシェアのススメ
hinac0
1
810
ルクソールとツタンカーメン
masakamayama
1
560
東工大 traP Kaggle班 機械学習講習会 2024
abap34
1
280
Repaso electricidade e electrónica
irocho
0
160
Featured
See All Featured
Teambox: Starting and Learning
jrom
132
8.7k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Writing Fast Ruby
sferik
626
61k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Designing for Performance
lara
604
68k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Become a Pro
speakerdeck
PRO
24
5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Docker and Python
trallard
40
3.1k
GraphQLの誤解/rethinking-graphql
sonatard
66
10k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
14
1.9k
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