forked from kirstykitto/Stats-githubDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusingGitHubExample.Rmd
163 lines (102 loc) · 2.84 KB
/
usingGitHubExample.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
title: "Finding correlations in the newStarwars dataset"
author: "Kirsty Kitto"
output:
html_document: default
html_notebook: default
---
Kirsty is having fun
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Cmd+Shift+Enter*.
Lets go get us a dataset!
```{r}
library(tidyverse)
starwars
```
Let's add a calculation for BMI
```{r}
starwars %>% mutate(BMI:=mass/((height/100)^2)) -> newStarwars
ggplot(data = newStarwars, mapping = aes(x = mass, y = BMI)) + geom_point()
```
Hmmm... should probably remove the outlier
```{r}
newStarwars %>% filter((BMI<400)) -> newStarwars
ggplot(data = newStarwars, mapping = aes(x = mass, y = BMI)) + geom_point()
```
Hmmmm. Looks not terribly informative... what about BMI vs height?
```{r}
ggplot(data = newStarwars, mapping = aes(x = height, y = BMI)) + geom_point()
```
Right... your challenge is to work out if there is a correlation between BMI and height! (And to show evidence of why you think there is/is not using R!)
===
Instructions
===
The repo that you have pulled includes:
1. A README file
1. This .Rmd file
1. A dataset (the newStarwars dataset)
Each group (around a table) will modify the first two of these files during this activity. (Remember to leave a commit message so we know what you are changing!)
Your group modifications should add a code chunk to this document that
1. Updates the group number title below with a heading that explains your approach towards finding correlations
1. Adds some standard text to explain how you are finding correlation in the newStarwars dataset
1. Includes a statistical analysis using a R function to explore whether there is a correlation between BMI and height
Group 1
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 2
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 3
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 4
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 5
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 6
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 7
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 8
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 9
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```
Group 10
===
Insert some text here
```{r}
#Code blocks can go inside these quoted delimeters
```