forked from clara-maria-barth/P02-Quanitative
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01 - Re-analysis.Rmd
45 lines (35 loc) · 856 Bytes
/
01 - Re-analysis.Rmd
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
---
title: "Re-analysis of Feit et al. (2016)"
output: html_notebook
---
```{r setup, include = FALSE}
library(tidyverse)
source("R/commons.R") # load functions that are shared across notebooks
```
Use Markdown to explain your analysis. Your code goes into each chunk like below.
```{r}
data_file_paths <- list.files("data/Feit2016/Typing/", full.names = TRUE)
```
Extract data:
```{r}
i = 0
for (path in data_file_paths){
participant <- paste("P", i, sep="")
assign(participant, read.delim(path))
i <- i + 1
}
```
Next:
```{r}
# from JSON
time_input <- aggregate(input_time~current_input, P1, sum )
# WPM calculation
for (i in nrow(time_input)){
line = time_input[i,]
word_count <- (str_length(line$current_input) - 1) / 5
word_count
time <-line$input_time
time_minute <- time / 1000 / 60
wpm <- word_count / time_minute }
wpm
```