-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateCodebook.Rmd
More file actions
65 lines (50 loc) · 1.81 KB
/
createCodebook.Rmd
File metadata and controls
65 lines (50 loc) · 1.81 KB
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
Codebook
========
Codebook was generated on `r as.character(Sys.time())` during the same process that generated the dataset. See `run_analysis.md` or `run_analysis.html` for details on dataset creation.
Variable list and descriptions
------------------------------
Variable name | Description
-----------------|------------
subject | ID the subject who performed the activity for each window sample. Its range is from 1 to 30.
activity | Activity name
featDomain | Feature: Time domain signal or frequency domain signal (Time or Freq)
featInstrument | Feature: Measuring instrument (Accelerometer or Gyroscope)
featAcceleration | Feature: Acceleration signal (Body or Gravity)
featVariable | Feature: Variable (Mean or SD)
featJerk | Feature: Jerk signal
featMagnitude | Feature: Magnitude of the signals calculated using the Euclidean norm
featAxis | Feature: 3-axial signals in the X, Y and Z directions (X, Y, or Z)
featCount | Feature: Count of data points used to compute `average`
featAverage | Feature: Average of each variable for each activity and each subject
Dataset structure
-----------------
```{r}
str(dtTidy)
```
List the key variables in the data table
----------------------------------------
```{r}
key(dtTidy)
```
Show a few rows of the dataset
------------------------------
```{r}
dtTidy
```
Summary of variables
--------------------
```{r}
summary(dtTidy)
```
List all possible combinations of features
------------------------------------------
```{r}
dtTidy[, .N, by=c(names(dtTidy)[grep("^feat", names(dtTidy))])]
```
Save to file
------------
Save data table objects to a tab-delimited text file called `TidyHumanActivity.txt`.
```{r save}
f <- file.path(path, "TidyHumanActivity.txt")
write.table(dtTidy, f, quote=FALSE, sep="\t", row.names=FALSE)
```