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
Canva
matleenalaakso
0
400
Web Architectures - Lecture 2 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
(2024) Couper un gâteau... sans connaître le nombre de convives
mansuy
2
120
20241004_Microsoft認定資格のFundamentals全部取ってみた
ponponmikankan
2
310
自己紹介 / who-am-i
yasulab
2
4.1k
Repaso electricidade e electrónica
irocho
0
160
Blogit opetuksessa
matleenalaakso
0
1.6k
小・中・高等学校における情報教育の体系的な学習を目指したカリキュラムモデル案/curriculum model
codeforeveryone
1
2.2k
Kindleストアで本を探すことの善悪 #Izumo Developers' Guild 第1回 LT大会
totodo713
0
120
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
790
AWS All Certが伝える 新AWS認定試験取得のコツ (Machine Learning Engineer - Associate)
nnydtmg
1
510
Contentless Marketing
jonoalderson
0
1.5k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Speed Design
sergeychernyshev
24
570
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
370
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Agile that works and the tools we love
rasmusluckow
327
21k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Writing Fast Ruby
sferik
626
61k
Designing the Hi-DPI Web
ddemaree
280
34k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
We Have a Design System, Now What?
morganepeng
50
7.2k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
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