forked from rdpeng/RepData_PeerAssessment1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PA1.html
387 lines (282 loc) · 58.7 KB
/
PA1.html
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=9" >
<title>Reproducible Research: Peer Assessment 1</title>
<style type="text/css">
body, td {
font-family: sans-serif;
background-color: white;
font-size: 12px;
margin: 8px;
}
tt, code, pre {
font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace;
}
h1 {
font-size:2.2em;
}
h2 {
font-size:1.8em;
}
h3 {
font-size:1.4em;
}
h4 {
font-size:1.0em;
}
h5 {
font-size:0.9em;
}
h6 {
font-size:0.8em;
}
a:visited {
color: rgb(50%, 0%, 50%);
}
pre {
margin-top: 0;
max-width: 95%;
border: 1px solid #ccc;
white-space: pre-wrap;
}
pre code {
display: block; padding: 0.5em;
}
code.r, code.cpp {
background-color: #F8F8F8;
}
table, td, th {
border: none;
}
blockquote {
color:#666666;
margin:0;
padding-left: 1em;
border-left: 0.5em #EEE solid;
}
hr {
height: 0px;
border-bottom: none;
border-top-width: thin;
border-top-style: dotted;
border-top-color: #999999;
}
@media print {
* {
background: transparent !important;
color: black !important;
filter:none !important;
-ms-filter: none !important;
}
body {
font-size:12pt;
max-width:100%;
}
a, a:visited {
text-decoration: underline;
}
hr {
visibility: hidden;
page-break-before: always;
}
pre, blockquote {
padding-right: 1em;
page-break-inside: avoid;
}
tr, img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page :left {
margin: 15mm 20mm 15mm 10mm;
}
@page :right {
margin: 15mm 10mm 15mm 20mm;
}
p, h2, h3 {
orphans: 3; widows: 3;
}
h2, h3 {
page-break-after: avoid;
}
}
</style>
<!-- Styles for R syntax highlighter -->
<style type="text/css">
pre .operator,
pre .paren {
color: rgb(104, 118, 135)
}
pre .literal {
color: rgb(88, 72, 246)
}
pre .number {
color: rgb(0, 0, 205);
}
pre .comment {
color: rgb(76, 136, 107);
}
pre .keyword {
color: rgb(0, 0, 255);
}
pre .identifier {
color: rgb(0, 0, 0);
}
pre .string {
color: rgb(3, 106, 7);
}
</style>
<!-- R syntax highlighter -->
<script type="text/javascript">
var hljs=new function(){function m(p){return p.replace(/&/gm,"&").replace(/</gm,"<")}function f(r,q,p){return RegExp(q,"m"+(r.cI?"i":"")+(p?"g":""))}function b(r){for(var p=0;p<r.childNodes.length;p++){var q=r.childNodes[p];if(q.nodeName=="CODE"){return q}if(!(q.nodeType==3&&q.nodeValue.match(/\s+/))){break}}}function h(t,s){var p="";for(var r=0;r<t.childNodes.length;r++){if(t.childNodes[r].nodeType==3){var q=t.childNodes[r].nodeValue;if(s){q=q.replace(/\n/g,"")}p+=q}else{if(t.childNodes[r].nodeName=="BR"){p+="\n"}else{p+=h(t.childNodes[r])}}}if(/MSIE [678]/.test(navigator.userAgent)){p=p.replace(/\r/g,"\n")}return p}function a(s){var r=s.className.split(/\s+/);r=r.concat(s.parentNode.className.split(/\s+/));for(var q=0;q<r.length;q++){var p=r[q].replace(/^language-/,"");if(e[p]){return p}}}function c(q){var p=[];(function(s,t){for(var r=0;r<s.childNodes.length;r++){if(s.childNodes[r].nodeType==3){t+=s.childNodes[r].nodeValue.length}else{if(s.childNodes[r].nodeName=="BR"){t+=1}else{if(s.childNodes[r].nodeType==1){p.push({event:"start",offset:t,node:s.childNodes[r]});t=arguments.callee(s.childNodes[r],t);p.push({event:"stop",offset:t,node:s.childNodes[r]})}}}}return t})(q,0);return p}function k(y,w,x){var q=0;var z="";var s=[];function u(){if(y.length&&w.length){if(y[0].offset!=w[0].offset){return(y[0].offset<w[0].offset)?y:w}else{return w[0].event=="start"?y:w}}else{return y.length?y:w}}function t(D){var A="<"+D.nodeName.toLowerCase();for(var B=0;B<D.attributes.length;B++){var C=D.attributes[B];A+=" "+C.nodeName.toLowerCase();if(C.value!==undefined&&C.value!==false&&C.value!==null){A+='="'+m(C.value)+'"'}}return A+">"}while(y.length||w.length){var v=u().splice(0,1)[0];z+=m(x.substr(q,v.offset-q));q=v.offset;if(v.event=="start"){z+=t(v.node);s.push(v.node)}else{if(v.event=="stop"){var p,r=s.length;do{r--;p=s[r];z+=("</"+p.nodeName.toLowerCase()+">")}while(p!=v.node);s.splice(r,1);while(r<s.length){z+=t(s[r]);r++}}}}return z+m(x.substr(q))}function j(){function q(x,y,v){if(x.compiled){return}var u;var s=[];if(x.k){x.lR=f(y,x.l||hljs.IR,true);for(var w in x.k){if(!x.k.hasOwnProperty(w)){continue}if(x.k[w] instanceof Object){u=x.k[w]}else{u=x.k;w="keyword"}for(var r in u){if(!u.hasOwnProperty(r)){continue}x.k[r]=[w,u[r]];s.push(r)}}}if(!v){if(x.bWK){x.b="\\b("+s.join("|")+")\\s"}x.bR=f(y,x.b?x.b:"\\B|\\b");if(!x.e&&!x.eW){x.e="\\B|\\b"}if(x.e){x.eR=f(y,x.e)}}if(x.i){x.iR=f(y,x.i)}if(x.r===undefined){x.r=1}if(!x.c){x.c=[]}x.compiled=true;for(var t=0;t<x.c.length;t++){if(x.c[t]=="self"){x.c[t]=x}q(x.c[t],y,false)}if(x.starts){q(x.starts,y,false)}}for(var p in e){if(!e.hasOwnProperty(p)){continue}q(e[p].dM,e[p],true)}}function d(B,C){if(!j.called){j();j.called=true}function q(r,M){for(var L=0;L<M.c.length;L++){if((M.c[L].bR.exec(r)||[null])[0]==r){return M.c[L]}}}function v(L,r){if(D[L].e&&D[L].eR.test(r)){return 1}if(D[L].eW){var M=v(L-1,r);return M?M+1:0}return 0}function w(r,L){return L.i&&L.iR.test(r)}function K(N,O){var M=[];for(var L=0;L<N.c.length;L++){M.push(N.c[L].b)}var r=D.length-1;do{if(D[r].e){M.push(D[r].e)}r--}while(D[r+1].eW);if(N.i){M.push(N.i)}return f(O,M.join("|"),true)}function p(M,L){var N=D[D.length-1];if(!N.t){N.t=K(N,E)}N.t.lastIndex=L;var r=N.t.exec(M);return r?[M.substr(L,r.index-L),r[0],false]:[M.substr(L),"",true]}function z(N,r){var L=E.cI?r[0].toLowerCase():r[0];var M=N.k[L];if(M&&M instanceof Array){return M}return false}function F(L,P){L=m(L);if(!P.k){return L}var r="";var O=0;P.lR.lastIndex=0;var M=P.lR.exec(L);while(M){r+=L.substr(O,M.index-O);var N=z(P,M);if(N){x+=N[1];r+='<span class="'+N[0]+'">'+M[0]+"</span>"}else{r+=M[0]}O=P.lR.lastIndex;M=P.lR.exec(L)}return r+L.substr(O,L.length-O)}function J(L,M){if(M.sL&&e[M.sL]){var r=d(M.sL,L);x+=r.keyword_count;return r.value}else{return F(L,M)}}function I(M,r){var L=M.cN?'<span class="'+M.cN+'">':"";if(M.rB){y+=L;M.buffer=""}else{if(M.eB){y+=m(r)+L;M.buffer=""}else{y+=L;M.buffer=r}}D.push(M);A+=M.r}function G(N,M,Q){var R=D[D.length-1];if(Q){y+=J(R.buffer+N,R);return false}var P=q(M,R);if(P){y+=J(R.buffer+N,R);I(P,M);return P.rB}var L=v(D.length-1,M);if(L){var O=R.cN?"</span>":"";if(R.rE){y+=J(R.buffer+N,R)+O}else{if(R.eE){y+=J(R.buffer+N,R)+O+m(M)}else{y+=J(R.buffer+N+M,R)+O}}while(L>1){O=D[D.length-2].cN?"</span>":"";y+=O;L--;D.length--}var r=D[D.length-1];D.length--;D[D.length-1].buffer="";if(r.starts){I(r.starts,"")}return R.rE}if(w(M,R)){throw"Illegal"}}var E=e[B];var D=[E.dM];var A=0;var x=0;var y="";try{var s,u=0;E.dM.buffer="";do{s=p(C,u);var t=G(s[0],s[1],s[2]);u+=s[0].length;if(!t){u+=s[1].length}}while(!s[2]);if(D.length>1){throw"Illegal"}return{r:A,keyword_count:x,value:y}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:m(C)}}else{throw H}}}function g(t){var p={keyword_count:0,r:0,value:m(t)};var r=p;for(var q in e){if(!e.hasOwnProperty(q)){continue}var s=d(q,t);s.language=q;if(s.keyword_count+s.r>r.keyword_count+r.r){r=s}if(s.keyword_count+s.r>p.keyword_count+p.r){r=p;p=s}}if(r.language){p.second_best=r}return p}function i(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"<br>")}return r}function n(t,w,r){var x=h(t,r);var v=a(t);var y,s;if(v){y=d(v,x)}else{return}var q=c(t);if(q.length){s=document.createElement("pre");s.innerHTML=y.value;y.value=k(q,c(s),x)}y.value=i(y.value,w,r);var u=t.className;if(!u.match("(\\s|^)(language-)?"+v+"(\\s|$)")){u=u?(u+" "+v):v}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){s=t.parentNode;var p=document.createElement("div");p.innerHTML="<pre><code>"+y.value+"</code></pre>";t=p.firstChild.firstChild;p.firstChild.cN=s.cN;s.parentNode.replaceChild(p.firstChild,s)}else{t.innerHTML=y.value}t.className=u;t.result={language:v,kw:y.keyword_count,re:y.r};if(y.second_best){t.second_best={language:y.second_best.language,kw:y.second_best.keyword_count,re:y.second_best.r}}}function o(){if(o.called){return}o.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p<r.length;p++){var q=b(r[p]);if(q){n(q,hljs.tabReplace)}}}function l(){if(window.addEventListener){window.addEventListener("DOMContentLoaded",o,false);window.addEventListener("load",o,false)}else{if(window.attachEvent){window.attachEvent("onload",o)}else{window.onload=o}}}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=n;this.initHighlighting=o;this.initHighlightingOnLoad=l;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.ER="(?![\\s\\S])";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(r,s){var p={};for(var q in r){p[q]=r[q]}if(s){for(var q in s){p[q]=s[q]}}return p}}();hljs.LANGUAGES.cpp=function(){var a={keyword:{"false":1,"int":1,"float":1,"while":1,"private":1,"char":1,"catch":1,"export":1,virtual:1,operator:2,sizeof:2,dynamic_cast:2,typedef:2,const_cast:2,"const":1,struct:1,"for":1,static_cast:2,union:1,namespace:1,unsigned:1,"long":1,"throw":1,"volatile":2,"static":1,"protected":1,bool:1,template:1,mutable:1,"if":1,"public":1,friend:2,"do":1,"return":1,"goto":1,auto:1,"void":2,"enum":1,"else":1,"break":1,"new":1,extern:1,using:1,"true":1,"class":1,asm:1,"case":1,typeid:1,"short":1,reinterpret_cast:2,"default":1,"double":1,register:1,explicit:1,signed:1,typename:1,"try":1,"this":1,"switch":1,"continue":1,wchar_t:1,inline:1,"delete":1,alignof:1,char16_t:1,char32_t:1,constexpr:1,decltype:1,noexcept:1,nullptr:1,static_assert:1,thread_local:1,restrict:1,_Bool:1,complex:1},built_in:{std:1,string:1,cin:1,cout:1,cerr:1,clog:1,stringstream:1,istringstream:1,ostringstream:1,auto_ptr:1,deque:1,list:1,queue:1,stack:1,vector:1,map:1,set:1,bitset:1,multiset:1,multimap:1,unordered_set:1,unordered_map:1,unordered_multiset:1,unordered_multimap:1,array:1,shared_ptr:1}};return{dM:{k:a,i:"</",c:[hljs.CLCM,hljs.CBLCLM,hljs.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},hljs.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:a,r:10,c:["self"]}]}}}();hljs.LANGUAGES.r={dM:{c:[hljs.HCM,{cN:"number",b:"\\b0[xX][0-9a-fA-F]+[Li]?\\b",e:hljs.IMMEDIATE_RE,r:0},{cN:"number",b:"\\b\\d+(?:[eE][+\\-]?\\d*)?L\\b",e:hljs.IMMEDIATE_RE,r:0},{cN:"number",b:"\\b\\d+\\.(?!\\d)(?:i\\b)?",e:hljs.IMMEDIATE_RE,r:1},{cN:"number",b:"\\b\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",e:hljs.IMMEDIATE_RE,r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",e:hljs.IMMEDIATE_RE,r:1},{cN:"keyword",b:"(?:tryCatch|library|setGeneric|setGroupGeneric)\\b",e:hljs.IMMEDIATE_RE,r:10},{cN:"keyword",b:"\\.\\.\\.",e:hljs.IMMEDIATE_RE,r:10},{cN:"keyword",b:"\\.\\.\\d+(?![\\w.])",e:hljs.IMMEDIATE_RE,r:10},{cN:"keyword",b:"\\b(?:function)",e:hljs.IMMEDIATE_RE,r:2},{cN:"keyword",b:"(?:if|in|break|next|repeat|else|for|return|switch|while|try|stop|warning|require|attach|detach|source|setMethod|setClass)\\b",e:hljs.IMMEDIATE_RE,r:1},{cN:"literal",b:"(?:NA|NA_integer_|NA_real_|NA_character_|NA_complex_)\\b",e:hljs.IMMEDIATE_RE,r:10},{cN:"literal",b:"(?:NULL|TRUE|FALSE|T|F|Inf|NaN)\\b",e:hljs.IMMEDIATE_RE,r:1},{cN:"identifier",b:"[a-zA-Z.][a-zA-Z0-9._]*\\b",e:hljs.IMMEDIATE_RE,r:0},{cN:"operator",b:"<\\-(?!\\s*\\d)",e:hljs.IMMEDIATE_RE,r:2},{cN:"operator",b:"\\->|<\\-",e:hljs.IMMEDIATE_RE,r:1},{cN:"operator",b:"%%|~",e:hljs.IMMEDIATE_RE},{cN:"operator",b:">=|<=|==|!=|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||\\$|:",e:hljs.IMMEDIATE_RE,r:0},{cN:"operator",b:"%",e:"%",i:"\\n",r:1},{cN:"identifier",b:"`",e:"`",r:0},{cN:"string",b:'"',e:'"',c:[hljs.BE],r:0},{cN:"string",b:"'",e:"'",c:[hljs.BE],r:0},{cN:"paren",b:"[[({\\])}]",e:hljs.IMMEDIATE_RE,r:0}]}};
hljs.initHighlightingOnLoad();
</script>
</head>
<body>
<h1>Reproducible Research: Peer Assessment 1</h1>
<h2>Loading and preprocessing the data</h2>
<p>The data was loaded:</p>
<pre><code class="r">data <- read.csv("./activity.csv")
</code></pre>
<h2>What is mean total number of steps taken per day?</h2>
<p>To find the total number of steps per day, the function ddply() from the plyr package is used to summarise the data:</p>
<pre><code class="r">library("plyr")
total.steps <- ddply(data, .(date), summarise, total.steps = sum(steps))
</code></pre>
<p>For plotting two additional factors are added, one for months and another for days of the week:</p>
<pre><code class="r">total.steps$month <- months(as.POSIXlt(total.steps$date))
total.steps$month <- factor(total.steps$month, levels = c("October", "November"))
total.steps$day <- weekdays(as.POSIXlt(total.steps$date))
total.steps$day <- factor(total.steps$day, levels = c("Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday",
"Sunday"))
</code></pre>
<p>A barplot of the data is created with ggplot, bar colours generated with functions from the RColorBrewer package:</p>
<pre><code class="r">total.steps$date <- gsub("^(.*)-", "", total.steps$date)
library("RColorBrewer")
blues <- colorRampPalette(brewer.pal(9,"Blues"))(12)
library("ggplot2")
hist1 <- ggplot(total.steps, aes(x = date, y = total.steps, facets = month, fill = day)) +
geom_bar(stat = "identity") + facet_grid(. ~ month) + theme_bw() + labs(title = "Total number of steps per day") + scale_fill_manual(values = blues[5:12])
hist1 + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, size = 8),
strip.background = element_rect(fill = c("white")))
</code></pre>
<p><img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5hy2Pnh0zyxWuidQw+xs83yrHMgUw6HQ3Kgkx0JMRHvLLyxQkYVQJNRBdBkVAE0GVUATUYVQJNRBdBkVAF0A9k9ZO/yJq/Kkh4D6AYCaH8CaNds74N//rdpcinaNK6TSyh6uRKYmADaNbNJtI4pv3o0p2dzho7vCPu9hPKSA2jHbF/PsylHXMagDW1zJ+klgHZMMmueTZPLia4T0OYSzeTn9kgPAbRj7Bl6ez+1Uw7Ozr0G0K5J59DmRL357NHOodc3i+MLkjYCaNfsHpJXOcLAfNk9JK9yMOPoLYAmowqgyagCaDKqAJqMKoAmowqgyagCaDKqAJqMKoAmowqgyajy/z6cIamn8wVxAAAAAElFTkSuQmCC" alt="plot of chunk unnamed-chunk-4"/> </p>
<p>The mean and median of the data were calculated:</p>
<pre><code class="r">mean(total.steps$total.steps, na.rm = T)
</code></pre>
<pre><code>## [1] 10766
</code></pre>
<pre><code class="r">median(total.steps$total.steps, na.rm = T)
</code></pre>
<pre><code>## [1] 10765
</code></pre>
<h2>What is the average daily activity pattern?</h2>
<p>The data was summarised per interval and then the mean number of steps per interval was calculated:</p>
<pre><code class="r">avg.steps <- ddply(data, .(interval), summarise, avg.steps = mean(steps, na.rm = T))
</code></pre>
<p>Some additional processing was carried out for plotting, intervals were converted into character strings that represented a 24 hour format, “00:00”:</p>
<pre><code class="r">avg.steps$time <- sprintf("%04d", avg.steps$interval)
avg.steps$time <- gsub("^([0-9]{2})([0-9]{2})$", "\\1:\\2", avg.steps$time)
avg.steps$group = c("g1") # Need to add a dummy group for plotting in ggplot
</code></pre>
<p>A line plot was created:</p>
<pre><code class="r">x.breaks <- seq(1, 288, by = 24)
plot1 <- ggplot(avg.steps, aes(x = time, y = avg.steps, group = group)) + geom_line() +
theme_bw() + labs(title = "Average number of steps per interval")
plot1 + scale_x_discrete(breaks = avg.steps$time[x.breaks],
labels = avg.steps$time[x.breaks])
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMA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/Ut+xzdQthL5y9Yaf9k6m79sJfKXrWoJlK1E/rK9MeFr0u2XpQeThkiojdEhUpNVcZedU6PnHp50y7zZLnpPZxfVU4GyRTPpKVtpAmUrUaBsnS1QtqwlWLYu2Fu2JyaP+PGkIRJ1010iPVP+GMIuYCR77xIUPYn3L+6SRDfi3RrdV76ytZG/7HYz85WtRYGy660nVLYq2F+2J1If468ve+s6/ZlC903wGH8KHePbljqOcfVOIXCMr0X+sru9gu8Yr7L5yx5si1aRqiVQthKFyvbE5LP66oDiO88+1MPCKWomL7uQkRxgQZE8q917RDWvQNlqD+0vuwc+YBQqW29mvrJVLYGylShUtidwHb/RAPiNBsBvNAB+owHwGw2Ar66o1UX1tgLgt0hdALz4eKaHf305Xn/8qq6IL/WtOTlr9RvD5sHrXf315Um8f1a3Ug87eVN15QHwGvyPVyH///j6Wj3ib3kvNgB+DP6ZKP7W51ID4MfgVz/aZQD8CLw8xke/ybXYAPjrizqr78BX+/rV7+kBfqsB8BsNgN9oAPxGA+A3GgC/0QD4jQbAbzQAfqMB8BuN/wcceogTs6llGwAAAABJRU5ErkJggg==" alt="plot of chunk unnamed-chunk-8"/> </p>
<p>The interval with the maximum number of steps was found:</p>
<pre><code class="r">avg.steps$time[which.max(avg.steps$avg.steps)]
</code></pre>
<pre><code>## [1] "08:35"
</code></pre>
<p>The interval from 08:35 to 08:40.</p>
<h2>Imputing missing values</h2>
<p>Count the number of “NA” in the data:</p>
<pre><code class="r">sum(is.na(data$steps))
</code></pre>
<pre><code>## [1] 2304
</code></pre>
<p>Impute strategy, replace the NA's with the mean value for that particular interval:</p>
<pre><code class="r">impute.values <- ddply(data, .(interval), summarise, mean = mean(steps, na.rm = T))
impute <- function(x, y){
if(is.na(x)){
x <- impute.values$mean[which(impute.values$interval == y)]
}
return(x)
}
data1 <- data
data1$steps <- mapply(impute, data$steps, data$interval)
</code></pre>
<p>The data was summarised and the total number of steps calculated. Two addtional factors were added to the dataframe, one for months and another for days of the week:</p>
<pre><code class="r">total.steps1 <- ddply(data1, .(date), summarise, total.steps = sum(steps))
total.steps1$month <- months(as.POSIXlt(total.steps1$date))
total.steps1$month <- factor(total.steps1$month, levels = c("October", "November"))
total.steps1$day <- weekdays(as.POSIXlt(total.steps1$date))
total.steps1$day <- factor(total.steps1$day, levels = c("Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday",
"Sunday"))
</code></pre>
<p>A barplot of the data was made:</p>
<pre><code class="r">total.steps1$date <- gsub("^(.*)-", "", total.steps1$date)
hist2 <- ggplot(total.steps1, aes(x = date, y = total.steps, facets = month, fill = day)) +
geom_bar(stat = "identity") + facet_grid(. ~ month) + theme_bw() +
labs(title = "Total number of steps per day") + scale_fill_manual(values = blues[5:12])
hist2 + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, size = 8),
strip.background = element_rect(fill = c("white")))
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAJACAMAAACT76HtAAAA51BMVEUAAAAAADoAAGYAOjoAOmYAOpAAZmYAZrYIR44TX6cndrg6AAA6ADo6AGY6Ojo6OmY6OpA6ZmY6ZrY6kJA6kNs/j8Rco9BmAABmADpmAGZmOgBmOjpmOmZmOpBmZjpmZmZmZrZmkJBmkLZmkNtmtrZmtv99uNp/f3+QOgCQOjqQOmaQZgCQZpCQkGaQkLaQtpCQ27aQ29uQ2/+hy+K2ZgC2Zjq2Zma2kDq2kJC2tma2/7a2/9u2///MzMzbkDrbkGbbtmbb25Db29vb/7bb/9vb///l5eX6+vr/tmb/25D//7b//9v///81jaw6AAAACXBIWXMAAAsSAAALEgHS3X78AAAcBklEQVR4nO3dC3vbRnaHcUitqjhKvI7LrOymzqW7tGV3s+kqzDabcNF2Y97x/T9PMcAMRPDwkAAHIAbg+38S+oiHuBDzMzwiISpKCBlQoq53gJAmA2gyqACaDCqAJoMKoMmgAmgyqACaDCqAJoMKoMmgAmgyqACaDCqAJoMKoMmgAmgyqACaDCqAJoMKoMmgcvGg/9H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zneyorL81X6X/bf40W3+b3piFE/NhkG7Z5Fyr3ep4rLZ0RNraSI3VurWebbVurUn5kJw1vmdo+1mk5qls3v9umh8p8ySzob1Nno5H+oR/zkfvzWySmTTHI3v636bNjx+mxWEuPuH0fKvN1+q32tIRaWsjNVbr1pqca7XFWncOyTnT2JQjfe6rz6fZ55Mmk9FWZ3V39Thx/y6Zv9v5IUu2/sVapveb5fb8Q9ir1QZ2SIq1nm21/Z9yFE+heCqiqNNpKW5+uDVP3Cn0zsGH5LPN7fn9aUeiX4fkUMceifIhOWd859BuLlbMnnaLWh03QS7mb2pRq2Pnh9vzxHKhdw4/JJ9tuvl96YjUORJeh+SUjtchOdix3+mUDslZExToYupVTMH0okbHzQ9L88RSoXeOPCTJQSdJW6BPeb4VOj6H5HDHfv+4fUjOmsuYctj54dM8cbfQO4ceYmeb5VlnT6YcHofkQMcdCTERP1t4Y4UMKoAmgwqgyaACaDKoAJoMKoAmgwqgyaAC6AayeXDv8mavypIOA+gGAuhwAmjfrO+jf/63cXYp2jits0soOrkSmJgA2jeTUbJMKb96NKdnc4ZO74i7vYTykgNoz6xfT92UIy1T0Ia2uZN0EkB7Jps1T8bZ5UTXGWhziWb2c3ukgwDaM/YMvb4f2ykHZ+dOA2jf5HNoc6JeffZo59DLm9nxBUkbAbRvNg/ZqxxxZP7YPGSvcjDj6CyAJoMKoMmgAmgyqACaDCqAJoMKoMmgAmgyqACaDCqAJoMKoMmg8v/80I+FHK8yTgAAAABJRU5ErkJggg==" alt="plot of chunk unnamed-chunk-13"/> </p>
<p>Recalculate the mean and median for the new dataframe with imputed values:</p>
<pre><code class="r">mean(total.steps1$total.steps, na.rm = T)
</code></pre>
<pre><code>## [1] 10766
</code></pre>
<pre><code class="r">median(total.steps1$total.steps, na.rm = T)
</code></pre>
<pre><code>## [1] 10766
</code></pre>
<h2>Are there differences in activity patterns between weekdays and weekends?</h2>
<p>Reworked the impute function to also group by weekend/weekday classification:</p>
<pre><code class="r">data2 <- data
data2$date <- as.POSIXlt(data2$date)
data2$day <- weekdays(data2$date)
data2$w <- ifelse(data2$day %in% c("Saturday", "Sunday"), "Weekend", "Weekday")
impute.values2 <- ddply(data2, .(interval, w), summarise, mean = mean(steps, na.rm = T))
impute <- function(x, y, z){
if(is.na(x)){
x <- impute.values2$mean[which(impute.values2$interval == y &
impute.values2$w == z)]
}
return(x)
}
data2$steps <- mapply(impute, data2$steps, data2$interval, data2$w)
</code></pre>
<p>Ddply() was used to find the mean number of steps per interval and further grouped by weekend/weekday:</p>
<pre><code class="r">avg.steps2 <- ddply(data2, .(w, interval), summarise, avg.steps = mean(steps, na.rm = T))
</code></pre>
<p>Made legible labels:</p>
<pre><code class="r">avg.steps2$time <- sprintf("%04d", avg.steps2$interval)
avg.steps2$time <- gsub("^([0-9]{2})([0-9]{2})$", "\\1:\\2", avg.steps2$time)
</code></pre>
<p>Repeated the code to make a line plot of the data split by weekday/weekend:</p>
<pre><code class="r">x.breaks <- seq(1, 288, by = 24)
plot2 <- ggplot(avg.steps2, aes(x = time, y = avg.steps, group = w, colour = w,
facets = w)) + geom_line() +
facet_wrap(~ w, ncol = 1) + theme_bw() +
labs(title = "Average number of steps per interval")
plot2 + scale_x_discrete(breaks = avg.steps2$time[x.breaks],
labels = avg.steps2$time[x.breaks]) +
theme(legend.position = "none", strip.background = element_rect(fill = c("white")))
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAAq1BMVEUAAAAAADoAAGYAOpAAZrYAv8Q6AAA6ADo6AGY6OgA6Ojo6OpA6ZrY6kNtmAABmADpmAGZmOjpmOpBmZjpmZmZmZrZmkJBmtrZmtv9/f3+QOgCQOjqQOmaQkGaQkLaQtpCQ27aQ2/+2ZgC2Zjq2Zma2tma225C2/7a2/9u2///bkDrbtmbb25Db29vb/7bb/9vb///l5eX4dm36+vr/tmb/25D//7b//9v///+NAcFYAAAACXBIWXMAAAsSAAALEgHS3X78AAAdjUlEQVR4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1Mg7m5Y8B3jRXP+uPX3ot0jggnELUzBuN0aOquvjyeeWf2Jdwqnp12+HNwVdbP6oIlNao8eE8flD7sZoANxK+BDpkDc4m3mDVsEE9zdzBSM2y2cxxcqgC9UAF+oAL5QFQ++PrES51aFCeBLpF4B/PP73c2/3zy8fP61Pi+68As07KXtvxlKB98M9S93++rpVlxROx3YtbWtC+AF+M/3Ffv/+cN9/Rd/4XO9Avge+Pe7XfwFsNUK4Hvgt9/bmQDeBM+O8dEfdaxXxYN/uROz+g58PdZvf6QH+FIF8IUK4AsVwBcqgC9UAF+oAL5QAXyhAvhCBfCF6v8BzaQ3J4ImJyEAAAAASUVORK5CYII=" alt="plot of chunk unnamed-chunk-18"/> </p>
<p>Noticeable peak observed only in the weekday data, this peak occurs between 08:00 and 09:00, suggesting travelling to work.</p>
</body>
</html>