Giter Site home page Giter Site logo

r_cleaning's Introduction

1. Download data

The script will download the data and unzip them all to the basename of the folder "project2017". After that, the working directory will be set to "project2017" folder to prepare for cleaning. (line 1-4)

2. Reading data

All file names, except for "README.txt" and "features_info.txt" in the working directory, are retrieved to perform fast reading on all of the datasets, attach them to a list, and convert them into tibbles before detaching all to the global environment. Before freeing tibbles to the global environment, the vector of file names is modified to remove the ".txt" and assign to the name of the list. (line 8-15)

3. Cleaning

Merging

Dataset "X_test", "subject_test", and "y_test" are columned-bound together, dataset "X_train", "subject_train", and "y_train" are columned-bound together. Those 2 tibbles that are just created will be row-bound to become "data" dataset with 563 variables and 10,299 observations. (line 16-17)

Naming

The "data" dataset is named. (line 18)

Label activities

Numbers in the "activity" variable in the "data" dataset will be searched and replaced by the corresponding activities labels found in "activity_labels" dataset. (line 19-23)

Extracting mean and standard deviation variables

The dataset is subset with all variables providing "mean" or "std" information, plus the "activity" and "subject" variables. (line 24)

4. Final dataset

The cleaned dataset is grouped by subjects and activities and then applied summarized_all to calculate the average for each variable for each activity group with 6 activities in each group. (line 25-27)

I didn't adjust the variables' names since tidy pricipals don't really say that.

r_cleaning's People

Contributors

ntdung96 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.