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
RBC202003_Day2_Period5
Search
sakaue
March 20, 2020
Education
0
32
RBC202003_Day2_Period5
sakaue
March 20, 2020
Tweet
Share
More Decks by sakaue
See All by sakaue
SappoRo.R #11「R によるThe Multilingual Eye-tracking COrpus (MECO) の探索的データ分析」
sakaue
0
75
RBC202003_Day2_Period6
sakaue
0
64
RBC202003_Day2_Period7
sakaue
0
60
Rbootcamp202003_Day2_p8.pdf
sakaue
0
67
RBC202003_Day1_Period1
sakaue
1
49
RBC202003_Day1_Period2
sakaue
0
52
RBC202003_Day1_Period3
sakaue
0
61
RBC202003_Day1_Period4
sakaue
0
35
Other Decks in Education
See All in Education
Medidas en informática
irocho
0
200
Canva
matleenalaakso
0
420
勉強する必要ある?
mineo_matsuya
2
1.5k
脳卒中になってしまった さあ、どうする
japanstrokeassociation
0
560
Web Application Frameworks - Lecture 4 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
Chapitre_1_-__L_atmosphère_et_la_vie_-_Partie_1.pdf
bernhardsvt
0
220
小・中・高等学校における情報教育の体系的な学習を目指したカリキュラムモデル案/curriculum model
codeforeveryone
2
2.3k
Web Architectures - Lecture 2 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
Ch2_-_Partie_2.pdf
bernhardsvt
0
100
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
signer
PRO
1
2.5k
20241002_Copilotって何?+Power_AutomateのCopilot
ponponmikankan
1
160
(2024) Couper un gâteau... sans connaître le nombre de convives
mansuy
2
140
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Done Done
chrislema
181
16k
Optimizing for Happiness
mojombo
376
69k
The Invisible Side of Design
smashingmag
297
50k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Practical Orchestrator
shlominoach
186
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Faster Mobile Websites
deanohume
305
30k
Transcript
2020-03-20 ୈ5ݶ σʔλͷཁ bootcamp
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
1. σʔλͷཁͷඞཁੑ • σʔλΛूΊ͚ͨͩͰԿஅͰ͖ͳ͍ • σʔλΛཁʢཁʣΛ͢Δ͜ͱͰɼશମ͕ Ͳ͏ͳ͍ͬͯͯɼΒ͖͕ͭͲ͏ͳ͍ͬͯ Δ͔͕ѲͰ͖Δ • தؒςετͰऔͬͨ55ྑ͍ʁɼѱ͍ʁ
• ظςετͷฏۉ͕80ͷ߹ɼશମతʹྑ͍Ͱ͖͙͍͋ʁ • ฏۉɾΒ͖ͭʢSDʣʹΑΔʢ͠ɼςετͷ༰ ʹΑΔʢ͠ɼԿΛ͔֬Ί͍͔ͨʹΑΔʣʣ
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
• sum() ؔ • x <- c(1, 2, 3, 4,
5) • sum(x) • sum(x[2 : 4]) • ϕΫτϧͷ2൪͔Β4൪ͷཁૉͷ૯ • y <- c(1:1000) • sum(y) • sum(y[27:89]) 2. ϕΫτϧΛͬͨཁ
• mean() ؔ: ฏۉΛٻΊΔ • ฏۉ: σʔλͷ૯ΛσʔλͷݸͰׂͬͨ • mean(x); mean(y)
• median() ؔ: தԝΛٻΊΔ • தԝ: খ͍͞ॱʹฒͨ࣌ʹਅΜதͷॱҐʹ͘Δ • median(x); median(y) • ฏۉͷ᠘ • ۃͳ͕ࠞ͟ΔͱӨڹΛड͚ͯ͠·͏ • a <- c(100, 200, 300, 400, 500) • mean(a); median(a) • b <- c(100, 200, 300, 400, 5000) • mean(b); median(b) 2. ϕΫτϧΛͬͨཁ
• max() ؔ: ࠷େΛٻΊΔ • min() ؔ: ࠷খΛٻΊΔ • var()
ؔ: ࢄΛٻΊΔ • sd() ؔ: ඪ४ภࠩΛٻΊΔ • summary() ؔ: ཁ౷ܭྔΛҰʹٻΊΔ • ࠷খ, தԝ, ฏۉ, ࠷େ, Լଆ25%, ্ଆ25% • max(x); max(y) • min(x); min(y) • var(x);var(y) • sd(x); sd(y) • summary(x); summary(y) 2. ϕΫτϧΛͬͨཁ
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
3. ߦྻΛͬͨཁ • ѻ͍ํϕΫτϧͷཁͱಉ͡ • matrix.4 <- matrix(c(1, 2, 3,
4, 5, 6, 7, 8, 9), nrow = 3, ncol = 3, byrow = TRUE) • matrix.4 ͰதΛ֬ೝ • sum(matrix.4) #ߦྻʹ͋Δͷ૯ • mean(matrix.4) #ߦྻશମͷฏۉ • sum(matrix.4[1,]) #ߦྻ1ߦͷ૯ • mean(matrix.4[,2:3]) #ߦྻ2-3ྻͷฏۉ
3. ߦྻΛͬͨཁ • ͪΐͬͱɾཁૉΛେ͖ͯ͘͠Έ·͠ΐ͏ • matrix.5 <- matrix(c(1:5000), nrow =
100, ncol = 50, byrow = TRUE) • matrix.5 ͰதΛ֬ೝ • sum(matrix.5) #ߦྻʹ͋Δͷ૯ • mean(matrix.5) #ߦྻશମͷฏۉ
3. ߦྻΛͬͨཁ • rowSums() ؔ; colSums() ؔ; • ߦ͝ͱྻ͝ͱʹ૯ΛٻΊΔؔ •
rowSums(matrix.4); rowSums(matrix.5) • colSums(matrix.4); colSums(matrix.5) • rowMeans () ؔ; colMeans() ؔ • ߦ͝ͱྻ͝ͱʹฏۉΛٻΊΔؔ • rowMeans(matrix.4); rowMeans(matrix.5) • colMeans(matrix.4); colMeans(matrix.5)
3. ߦྻΛͬͨཁ • apply() ؔ • ߦ͝ͱྻ͝ͱʹ༷ʑͳؔΛద༻ • apply(ߦྻ໊, Ϛʔδϯ,
ద༻͢Δؔʣ • Ϛʔδϯ͕1ͳΒߦ͝ͱɼ2ͳΒྻ͝ͱ • apply(matrix.4, 1, sum) #ߦ͝ͱͷ૯ • rowSums(matrix.4) ͱಉ͡ॲཧ • apply(matrix.4, 2, mean) #ྻ͝ͱͷฏۉ • colMeans(matrix.4) ͱಉ͡ॲཧ
3. ߦྻΛͬͨཁ • apply() ؔͷଓ͖ • apply(matrix.4, 1, max) •
#ߦ͝ͱͷ࠷େ • apply(matrix.4, 2, summary) • #ྻ͝ͱͷཁ౷ܭྔ
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
Agenda 1. σʔλͷཁͷඞཁੑ (5) 2. ϕΫτϧΛͬͨཁ (20) 3. ߦྻΛͬͨཁ (20)
4. ԋशʹ͙࣍ԋश (45)
4. ԋशʹ͙࣍ԋश 1. 1͔Β50͔Β·Ͱͷ͕ೖͬͨϕΫτ ϧΛ࡞ͯ͠… 1. ૯, ฏۉ, தԝ, ࠷େ,
࠷খ , ࢄ, ඪ४ภࠩΛٻΊΔ 2. ཁ౷ܭྔΛٻΊΔ
4. ԋशʹ͙࣍ԋशʢώϯτʣ 1. Λൃੜͤ͞ΔʹίϩϯΛ͍·͠ΐ͏ 1. ֤ؔΛηϛίϩϯͰͭͳ͍ͰҰؾʹ࣮ߦ 2. summary() ؔΛ͍·͢
2. 1͔Β10000·Ͱͷ͕ೖͬͨߦྻʢ100ߦɾ100ྻʣΛ࡞ͯ͠… 1. 20ߦʮͱʯ70ߦͷ2ߦͷΈͷ֤૯ΛٻΊΔ 2. 31ྻʮ͔Βʯ80ྻ·Ͱͷ50ྻͷ֤ฏۉΛٻΊΔ 3. ߦ͝ͱɾྻ͝ͱͷ૯ΛٻΊΔʢapply ؔΛ༻ʣ 4.
ߦ͝ͱɾྻ͝ͱͷฏۉΛٻΊΔʢapply ؔΛ༻ʣ 5. ߦ͝ͱɾྻ͝ͱͷཁ౷ܭྔΛٻΊΔʢapply ؔΛ༻ʣ 6. psych ύοέʔδΛͬͯཁ౷ܭྔΛٻΊΔ • ҙͷߦɾྻʹରͯ͠ٻΊͯΈΔ 4. ԋशʹ͙࣍ԋश
2. matrix() ؔΛ͍ɼྻͷࢦఆͱ byrow ͷઃఆʹ༻৺ 1. ߦͷෳࢦఆ c() ؔΛ͍·͠ΐ͏ 2.
ྻͷൣғࢦఆίϩϯΛ͍·͠ΐ͏ 3. apply() ؔͱ sum() ؔΛΈ߹Θͤ·͠ΐ͏ 4. apply() ؔͱ mean() ؔΛΈ߹Θͤ·͠ΐ͏ 5. apply() ؔͷߦͱྻͷࢦఆɼ1 ͔ 2 Ͱ͚·͢ 6. ·ͣ install.packages() ͯ͠ library() Ͱ༗ޮԽ 4. ԋशʹ͙࣍ԋशʢώϯτʣ
Enjoy ! twitter: @sakaue e-mail: tsakaue<AT>hiroshima-u.ac.jp