Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/p10ns11y/tidygetdat-012

Getting and Cleaning Data Course Project
https://github.com/p10ns11y/tidygetdat-012

Last synced: 8 days ago
JSON representation

Getting and Cleaning Data Course Project

Awesome Lists containing this project

README

        

code{white-space: pre;}

pre:not([class]) {
background-color: white;
}

if (window.hljs && document.readyState && document.readyState === "complete") {
window.setTimeout(function() {
hljs.initHighlighting();
}, 0);
}

.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}


Tidygetdat-012


Getting and Cleaning Data Course Project



How the code works



  • It first merges the training and test data sets into one using ‘merge’ function

  • To extract only mean and standard deviation, ‘grep’ function used over features.txt and the extracted names used on X - 561 vector features

  • ‘gsub’ function used to name activities in the data set descriptively


  • using ‘names’ property , variables are appropirately labled

  • ‘cbind’ function helps to merge the activity ,subject , extracted features into single dataframe


  • Finally, using ‘melt’ and ‘dcast’ the required tidy data is created




// add bootstrap table styles to pandoc tables
$(document).ready(function () {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
});

(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();