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
小学生にスクラムを試してみた件~中学受検までの100週間の舞台裏~
ukky86
0
340
1030
cbtlibrary
0
300
20241004_Microsoft認定資格のFundamentals全部取ってみた
ponponmikankan
2
330
技術を楽しもう/enjoy_engineering
studio_graph
1
420
小・中・高等学校における情報教育の体系的な学習を目指したカリキュラムモデル案/curriculum model
codeforeveryone
2
2.3k
世界のオープンソースロボットたち #1
shiba_8ro
0
140
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
820
ACT FAST 20240830
japanstrokeassociation
0
320
Epithelium Flashcards
ndevaul
0
1k
Ch2_-_Partie_1.pdf
bernhardsvt
0
110
(2024) Couper un gâteau... sans connaître le nombre de convives
mansuy
2
150
横浜国立大学大学院 国際社会科学府 経営学専攻博士課程前期(社会人専修コース)_在校生体験談
miki_small_pin
0
700
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Ruby is Unlike a Banana
tanoku
97
11k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Practical Orchestrator
shlominoach
186
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Code Review Best Practice
trishagee
64
17k
KATA
mclloyd
29
14k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
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