-
Notifications
You must be signed in to change notification settings - Fork 0
/
PA1_template.html
386 lines (284 loc) · 49.2 KB
/
PA1_template.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>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Reproducible Research - Assignment 1</title>
<script type="text/javascript">
window.onload = function() {
var imgs = document.getElementsByTagName('img'), i, img;
for (i = 0; i < imgs.length; i++) {
img = imgs[i];
// center an image if it is the only element of its parent
if (img.parentElement.childElementCount === 1)
img.parentElement.style.textAlign = 'center';
}
};
</script>
<!-- Styles for R syntax highlighter -->
<style type="text/css">
pre .operator,
pre .paren {
color: rgb(104, 118, 135)
}
pre .literal {
color: #990073
}
pre .number {
color: #099;
}
pre .comment {
color: #998;
font-style: italic
}
pre .keyword {
color: #900;
font-weight: bold
}
pre .identifier {
color: rgb(0, 0, 0);
}
pre .string {
color: #d14;
}
</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>
<style type="text/css">
body, td {
font-family: sans-serif;
background-color: white;
font-size: 13px;
}
body {
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 20px;
}
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, img {
max-width: 100%;
}
pre {
overflow-x: auto;
}
pre code {
display: block; padding: 0.5em;
}
code {
font-size: 92%;
border: 1px solid #ccc;
}
code[class] {
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>
</head>
<body>
<h1>Reproducible Research - Assignment 1</h1>
<p>Marty Cluck</p>
<h2>Introduction (from assignment specifications)</h2>
<p>It is now possible to collect a large amount of data about personal movement using activity monitoring devices such as a Fitbit, Nike Fuelband, or Jawbone Up. These type of devices are part of the “quantified self” movement - a group of enthusiasts who take measurements about themselves regularly to improve their health, to find patterns in their behavior, or because they are tech geeks. But these data remain under-utilized both because the raw data are hard to obtain and there is a lack of statistical methods and software for processing and interpreting the data. This assignment makes use of data from a personal activity monitoring device. This device collects data at 5 minute intervals throughout the day. The data consists of two months of data from an anonymous individual collected during the months of October and November, 2012 and include the number of steps taken in 5 minute intervals each day.</p>
<p>The data for this assignment can be downloaded from the course web site:</p>
<p><a href="https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2Factivity.zip">Activity monitoring dataset</a></p>
<p>The variables included in this dataset are:</p>
<ul>
<li><p>steps: Number of steps taking in a 5-minute interval (missing values are coded as NA)</p></li>
<li><p>date: The date on which the measurement was taken in YYYY-MM-DD format</p></li>
<li><p>interval: Identifier for the 5-minute interval in which measurement was taken</p></li>
</ul>
<p>The dataset is stored in a comma-separated-value (CSV) file and there are a total of 17,568 observations in this dataset.</p>
<h3>Load and preprocess data from the csv file</h3>
<pre><code class="r">extractedData <- read.csv("./data/activity.csv")
</code></pre>
<h3>What is the mean total number of steps taken per day?</h3>
<p>For this part of the assignment, you can ignore the missing values in the dataset.</p>
<ol>
<li>Calculate the total number of steps taken per day.</li>
</ol>
<pre><code class="r">dailySteps <- aggregate(steps ~ date, extractedData, sum)
</code></pre>
<ol>
<li>Make a histogram of the toal number of steps per day.</li>
</ol>
<pre><code class="r">hist(dailySteps$steps, main = "Total Daily Steps", xlab = "Number of Steps")
abline(v = median(dailySteps$steps), col = "blue", lwd = 2)
abline(v = mean(dailySteps$steps), col = "red", lty = 4, lwd = 3)
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAAz1BMVEUAAAAAADoAAGYAAP8AOjoAOmYAOpAAZrY6AAA6ADo6AGY6OgA6OmY6OpA6ZpA6ZrY6kJA6kLY6kNtmAABmADpmAGZmOgBmOpBmZjpmZmZmkLZmkNtmtttmtv+QOgCQOjqQOmaQZgCQZjqQZmaQkDqQkGaQkJCQtmaQtpCQttuQ27aQ29uQ2/+2ZgC2Zjq2kGa2tma2ttu22/+2/9u2///bkDrbkGbbtmbbtpDb2//b/7bb/9vb////AAD/tmb/tpD/25D/27b//7b//9v///8Yfuz7AAAACXBIWXMAAAsSAAALEgHS3X78AAAQVUlEQVR4nO2dj3/ithmHnVwb0muz28K1W7smd/vdreG2dWHtOsoo8P//TbNsKYFEseG1AL16n+fzuSOB+CvJD7IlG+NqDSapTl0BOA2INwrijYJ4oyDeKIg3CuKNgnijIN4oiDcK4o2CeKMg3iiINwrijYJ4oyDeKIg3CuKNgnijIN4oiDcK4o2CeKMg3ijFiV/dVg2jx2c+3Dz8vByf37eP7m8++nq99Up49YGfv6iqX8y2IwrBgPhJ9ZL4qrreWvap+PavRtsRhVCc+JrF5UXdS9f/vqzOvpo1b4TRelH33Y/vNsS7x++r+v+NV+p//7qtn5r7N4QL+tk910Ss/l4Hfu3eWud/uaw+rpf/36f1ot+dsqlyyhU/aTt+K77tuxezbf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DmCxhuQtL2w761qRsdzZHEubB0dXupStIwcc0SiXdflDJQvNtu1e9fn7T9sG9U7SqaI4lr3kWp6ra6vU5XMxcmrlk+Pb5hcpNlj09Vt+X4ep2sZk2YuGb57OMbXtgD7pmySLeP3xI/NGxx6UZiiWrWholrlmxUfz10VO+2T6v39z5p+2FPXKOjOZK4sN8YXjevKk3NfJi4ZnnN48/uEky8DzSPH163aXO9y02amoUwac04cmcUxBsF8UZBvFEQbxTEGwXxRkG8URBvFMQbBfFGQbxREG8UxBsF8UZBvFEQbxTEGwXxRkG8UUoW334QNf4548lN5MmW1W3lPrDurlE5T/Oh8RwpW7y73nFv8e0Cy7G7FPVihnh9LF7/Y9R4bK6seX2/evenqrqeV65DT74MVyy7Xv3ZF+et7Pq3+j/3eeX2I9pv/+afclcif/7H5pV5EXdYLlv8fd2xN8TfjuqtwKhxOmn78qS58iBclDJpLmxr+/jqtv1k+uNfLccXs/l5c5nK0CvCM6Bw8ctfzzZ7fHOBYXNZmdvUT27cT7VIvzl3St2VZ37jPm8uVXAh7V+5jX+9eIpLBDOgcPHr6XVc/Ie7Rry7yPgsqF60V8Jv7NUXn7jf/F81xt0m5LLZ4iundPGrd9+81ONXt821huuH8d9Wj2++eMBdh9peg7huv4PCfw/BfOjlYqendPHN0N4pm55vix+Fvff8ceS++Vszqvdvg/b55XjkHpx0xGdNa7A27q4s/OXn2+K/DNcatvvxZgE/xvf9f9zs41e3YaC/fPubZpkJo3pbFDKq8yB+ZxAPBYB4oyDeKIg3CuKNgnijIN4oiDcK4o2CeKMg3iiINwrijYJ4oyDeKIg3yv8BjSoDnU46YnYAAAAASUVORK5CYII=" alt="plot of chunk unnamed-chunk-3"/></p>
<ol>
<li>Calculate and report the mean and median of the total number of steps per day.</li>
</ol>
<pre><code class="r">dailyMeanSteps <- mean(dailySteps$steps)
dailyMedianSteps <- median(dailySteps$steps)
</code></pre>
<p>The daily mean of steps = 1.0766189 × 10<sup>4</sup>.
The daily median of steps = 10765.</p>
<h3>What is the daily average activity pattern?</h3>
<ol>
<li>Make a time series plot (i.e. type = “l”) of the 5-minute interval (x-axis) and the average number of steps taken, averaged across all days (y-axis).</li>
</ol>
<pre><code class="r">intervalMeanSteps <- aggregate(steps ~ interval, extractedData, mean)
plot(intervalMeanSteps$interval, intervalMeanSteps$steps, type="l", main = "Average Steps per Day by Interval",xlab = "Interval", ylab = "Number of Steps")
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAAulBMVEUAAAAAADoAAGYAOjoAOmYAOpAAZrY6AAA6ADo6AGY6OgA6OmY6OpA6ZpA6ZrY6kLY6kNtmAABmADpmAGZmOgBmZmZmkLZmkNtmtttmtv+QOgCQOjqQOmaQZgCQZjqQZmaQkJCQtmaQtpCQ29uQ2/+2ZgC2Zjq2kDq2kGa2ttu225C227a22/+2/7a2/9u2///bkDrbtmbbtpDb2//b/7bb/9vb////tmb/tpD/25D/27b//7b//9v///9LXjddAAAACXBIWXMAAAsSAAALEgHS3X78AAATv0lEQVR4nO2dC3vbthWGISe2ltTt7CbdKqXtttbuui2d1S6Tpkj8/39rBG/iBRRB3Ajy+96njSSSODjCywtAk5RICCRi6gTINFA8KBQPCsWDQvGgUDwoFA8KxYNC8aBQPCgUDwrFg0LxoFA8KBQPCsWDQvGgUDwoFA8KxYNC8aBQPCgUDwrFg0LxoMQp/rwVdxbFP78X4st9GubnjUWU06NIefWtcuZ5e/PSLVCfplN5s0RQ4hR/XAuLFsmNpWvOs7AXL8SDauaweJ3KKb7FTnwjm+2QNbpswfMva7H6Vrb36pv1zcdjukm/fko//iBe/+vxdl/Nzziub/efH2/+vc30X4re/G0tXqcN/b+3aemP2aKXia0aktLKb3IVzOvLZOc5FQW/3NenyQJFwI/nduUy6i/V9ym+AMU3SVvvn+s72ZKpU6kxbax828va8/ZTti3e7rNPr+rzM47r1bf7JCnavlFUljoVpfOaiomtGuTMwkrqqSyxS5U9r54aBWvTcvHZ9DtV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0X89iK06gxT914PYqjNI0X89iK06gxT914PYqjNI0X89iK06gxQnrodEBsWDQvGgUDwoFA8KxYNC8aBQPCgUDwrFg+JK/OlRdO+jNmInsltzi4AO4h7fvCStcHZRs4AO05TPHNm4TXEYR+LlXfS7Oyehnje1gA7iHqSfZji7qFlAh2mevn5Kjn94cpmiBo7Ey+dlZBuCNecPT7WA9nGfVz+m5ZvhrKLmAR2meZB+nzcOU9TBkfjj/T5bc+3JnsOwKQO6iCvbrxnOMqoM6DjNTm7uGrQHR+Llg1Lc5Jnu9OTmVAR0EVd6aoazjJqtSU7TPG8f3KY4THRbfMbzJvYt3mmap8eHxG2Kw0R3jM9oH/Gsgh3dHuMb4p0EPK5lR3Gex3i5r3LTCZX7uPN3L0VAF3Fl+zXDWUYtjx2O0sy9u01xmCjH8asnl8NZb+N4R2nusvteNvMcx5O5QfGgUDwoFA8KxYNC8aBQPCgUDwrFg0LxoFA8KBQPCsWDQvGgUDwoFA8KxYNC8aBQPCgUDwqo+MuVy/3XMHu9unlyKJ7ikUilHu+/F2JzehQ3L9k/yfGL9/KK5vOHp/y+ZYpfIFL8OrtfTep9zm5eOK438h7Y4/0ned9yugDFL4/Ca/4i71E7vcsm7B7kf0lSfl4uFP/mJbvlefWU31z5X3nj+7N82gXFL5Cm+HcvxbT0AP/j/f70uOGufqE0xMtjfHG0T3biobz/neIXyEX8eZv16ldPeS9ePvBA3sb4+v2G4skCoXhQKB4UigeF4kGheFAoHhSKB4XiQaF4UCgeFIoHheJBoXhQKB4UigeF4kGheFD+D1E2cR2zXxaKAAAAAElFTkSuQmCC" alt="plot of chunk unnamed-chunk-5"/></p>
<ol>
<li>Which 5-minute interval, on average across all the days in the dataset, contains the maximum number of steps?</li>
</ol>
<pre><code class="r">maxIntervalIndex <- which.max(intervalMeanSteps$steps)
maxInterval <- intervalMeanSteps[maxIntervalIndex,"interval"]
maxIntervalSteps <- intervalMeanSteps[maxIntervalIndex,"steps"]
</code></pre>
<p>The maximum interval is interval 835 with 206.1698113 steps.</p>
<h3>Imputing missing values</h3>
<p>Note that there are a number of days/intervals where there are missing values (coded as NA). The presence of missing days may introduce bias into some calculations or summaries of the data. </p>
<ol>
<li>Calculate and report the total number of missing values in the dataset (i.e. the total number of rows with NAs)</li>
</ol>
<pre><code class="r">incompleteCases <- sum(!complete.cases(extractedData))
</code></pre>
<p>There are 2304 rows with NAs.</p>
<ol>
<li>Devise a strategy for filling in all of the missing values in the dataset. The strategy does not need to be sophisticated. For example, you could use the mean/median for that day, or the mean for that 5-minute interval, etc.</li>
</ol>
<p>What will be used here is the mean for the 5-minute interval. First we need to create a new dataset to store the updated data.</p>
<ol>
<li>Create a new dataset that is equal to the original dataset but with the missing data filled in.</li>
</ol>
<p>Now populate the NA values with the mean values for the respective intervals.</p>
<pre><code class="r">modified <- extractedData
for(i in 1:length(modified$steps))
{
if(is.na(modified$steps[i]))
{
modified$steps[i] <- intervalMeanSteps[which(modified$interval[i] == intervalMeanSteps$interval),]$steps
}
}
</code></pre>
<p>Recount the the total of steps by day.</p>
<pre><code class="r">modifiedDailySteps <- aggregate(steps ~ date, modified, sum)
</code></pre>
<ol>
<li>Make a histogram of the total number of steps taken each day and Calculate and report the mean and median total number of steps taken per day. Do these values differ from the estimates from the first part of the assignment? What is the impact of imputing missing data on the estimates of the total daily number of steps?</li>
</ol>
<pre><code class="r">par(mfrow = c(1,2))
hist(dailySteps$steps, main = "Total Daily Steps (with NAs)", xlab = "Number of Steps")
abline(v = median(dailySteps$steps), col = "blue", lwd = 2)
abline(v = mean(dailySteps$steps), col = "red", lty = 4, lwd = 3)
hist(modifiedDailySteps$steps, main = "Total Daily Steps (No NAs)", xlab = "Number of Steps")
abline(v = median(modifiedDailySteps$steps), col = "blue", lwd = 2)
abline(v = mean(modifiedDailySteps$steps), col = "red", lty = 4, lwd = 3)
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAA21BMVEUAAAAAADoAAGYAA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mlL6cin33v8RHzSfUfd6Yvj6eppU+nIp997/d3z1CShftC3zF4avJrO00pdLuffUVv30oNXoTy+bd3fVov2XiPxnJIVX3hNKXy7l3nn68aPbhz3Ji/qyF4cvwg0ks4TSBOn2jpE7owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4owJ4o+IFX/4C9PgPfOezI2+W2twU/pfi/uaQJzy/jX4EZe6dG7y/FfBi82XA+trfA3p1rxZ81t6ZwT/7+zh4CTcIPbvbvP1TUUyXhd+p51+Eu3vdru337E9fPykNu/+5v/wPhYPp9atvqrf8LcCffRWWLPme89ufMvfODf7O7dwt8zdjdySMg695uT/Pw0/+67tB3P+W9X6+uSl/Er5ba319db98Eu4P4bhFol9l7p0d/Pq39+29PtzZF+7n8qe7+cz/y5mpTmnelr/lqzrBLcM9Aj5JuZY/Abpwjjvh+lfm3tnBbxfT4+bf3wbz/u7eUW13Vd4k3vpmW33i/1etFVz7w2gSznp5K3Pv/OA3b78+tddvbsJNftumDbS314c7/v0NoOXNf9ty8odqAoAly11RfSpz7/zgQ/PWf+zFk33z4/obbLlrvbb/F1q21aYo319fj/2LN64DfMbeHwG8d+1v6fv1Z/vmv6hv8iu/y0JA1c6tjoHr8D23uakbu+tXn4eYuY5WfdbeVY3c6WjV8ahv7wCvRKbBQ/0J4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I0K4I3q/4xissczn8oOAAAAAElFTkSuQmCC" alt="plot of chunk unnamed-chunk-10"/></p>
<pre><code class="r">modifiedDailyMean <- mean(modifiedDailySteps$steps)
modifiedDailyMedian <- median(modifiedDailySteps$steps)
dev.off()
</code></pre>
<pre><code>## null device
## 1
</code></pre>
<p>We can observe that the original daily mean and the mean for the complete data are the same (original mean = 1.0766189 × 10<sup>4</sup>, modified mean = 1.0766189 × 10<sup>4</sup>). However the original median = 10765 differs from the complete median = 1.0766189 × 10<sup>4</sup>. Also the frequency of days of the mean step count increased.</p>
<h3>Are there any differences in activity patterns between weekdays and weekends?</h3>
<p>For this part the weekdays() function may be of some help here. Use the dataset with the filled-in missing values for this part.</p>
<ol>
<li>Create a new factor variable in the dataset with two levels - “weekday” and “weekend” indicating whether a given date is a weekday or weekend day.</li>
</ol>
<pre><code class="r">modified$dow <- weekdays(as.Date(modified$date))
modified$dayType[(modified$dow =="Saturday" | modified$dow =="Sunday")]<-"weekend"
modified$dayType[!(modified$dow =="Saturday" | modified$dow =="Sunday")]<-"weekday"
</code></pre>
<ol>
<li>Make a panel plot containing a time series plot (i.e. type = “l”) of the 5-minute interval (x-axis) and the average number of steps taken, averaged across all weekday days or weekend days (y-axis). </li>
</ol>
<pre><code class="r">modifiedIntervalAverageWeekend <- aggregate(steps ~ interval, data = modified, subset = dayType == "weekend", FUN = mean)
modifiedIntervalAverageWeekday <- aggregate(steps ~ interval, data = modified, subset = dayType == "weekday", FUN = mean)
par(mfrow = c(1,2), t)
plot(modifiedIntervalAverageWeekend, type = "l", main = "Weekend Interval Step Avg")
plot(modifiedIntervalAverageWeekday, type = "l", main = "Weekday Interval Step Avg")
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAAwFBMVEUAAAAAADoAAGYAOjoAOmYAOpAAZrY6AAA6ADo6AGY6OgA6Ojo6OmY6OpA6ZpA6ZrY6kLY6kNtmAABmADpmAGZmOgBmZgBmZmZmkJBmkNtmtpBmtrZmtttmtv+QOgCQOjqQOmaQZgCQZjqQZmaQkJCQtmaQtpCQ29uQ2/+2ZgC2Zjq2kDq2kGa2ttu225C227a22/+2/7a2/9u2///bkDrbtmbbtpDb/7bb/9vb////tmb/25D/27b//7b//9v////Q7u6MAAAACXBIWXMAAAsSAAALEgHS3X78AAAVGElEQVR4nO2dC2PbthWFr9zEWra6mZ1k7bYqyV6t3XVbO6vNbEXC//9XI/gEJfAF4JIA7znrbIXAuRdXHx8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