-
Notifications
You must be signed in to change notification settings - Fork 2
/
scoreboard.Rmd
123 lines (83 loc) · 3.62 KB
/
scoreboard.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
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
---
title: "scoreboard"
author: "Thea Rolskov Sloth"
date: "10/5/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r loading packages, include = FALSE}
#install.packages("tidybayes"); install.packages("LaplacesDemon")
library(brms); library(tidyverse); library(tidybayes); library(ggplot2); library(LaplacesDemon); library(rethinking); library(tidyr); library(reshape2);library(pacman); library(tibble);library(tidyr) ;library(pacman)
p_load(plotly, jpeg)
```
```{r loading data and merging, include = FALSE}
#setwd("~/Cognitive Science/4. Semester/Social and Cultural Dynamics Exam/SocKultExam-master/")
setwd("~/SocKultExam")
data_path = ("~/SocKultExam/Data/")
#lets loop
files <- list.files(path = data_path)
files
data <- data.frame(matrix(ncol = 36, nrow = 0))
for (i in files) {
d <- read.delim(file = paste(data_path, i, sep = ""), sep = ",", header = TRUE)
data = rbind(data,d)
}
#KIRIS DATA
kiri_path = ("~/SocKultExam/")
kiri_files <- list.files(path = kiri_path, pattern = "*.csv")
kiri_files
kiri_data <- data.frame(matrix(ncol = 35, nrow = 0))
for (i in kiri_files) {
d <- read.delim(file = paste(kiri_path, i, sep = ""), sep = ",", header = TRUE, stringsAsFactors = FALSE)
kiri_data = rbind(kiri_data, d)
}
#merge the two
kiri_data <- add_column(kiri_data, Computer = "Two screens", .after = 4)
data <- rbind(data, kiri_data)
unique(data$GroupNumber)
```
```{r clean data, include = FALSE}
#CLEAN DATA
data <- subset(data, select = -c(X))
data$GroupNumber[data$GroupNumber == "17_10_30"] <- 17
data$GroupNumber[data$GroupNumber == "18_10_30"] <- 18
data$GroupNumber[data$GroupNumber == "19_10_50"] <- 19
data$GroupNumber[data$GroupNumber == "20_10_50"] <- 20
data$GroupNumber[data$GroupNumber == "21_12_15"] <- 21
data$GroupNumber[data$GroupNumber == "22_12_15"] <- 22
data$GroupNumber[data$GroupNumber == "23_12_40"] <- 23
data$GroupNumber[data$GroupNumber == "24_12_40"] <- 24
data$GroupNumber[data$GroupNumber == "25_15_00"] <- 25
data$GroupNumber[data$GroupNumber == "26_15_00"] <- 26
data$GroupNumber[data$GroupNumber == "27_15_20"] <- 27
data$GroupNumber[data$GroupNumber == "28_15_20"] <- 28
data$GroupNumber[data$GroupNumber == "29_16_00"] <- 29
data$GroupNumber[data$GroupNumber == "30_16_00"] <- 30
data$GroupNumber[data$GroupNumber == "31_16_20"] <- 31
data$GroupNumber[data$GroupNumber == "32_16_20"] <- 32
data$GroupNumber[data$GroupNumber == "33_9_30"] <- 33
data$GroupNumber[data$GroupNumber == "34_09_30"] <- 34
data$GroupNumber[data$GroupNumber == "35_09_50"] <- 35
data$GroupNumber[data$GroupNumber == "36_9_50"] <- 36
data$GroupNumber[data$GroupNumber == "37_26_4"] <- 37
data$GroupNumber[data$GroupNumber == "38_26_4"] <- 38
data$GroupNumber[data$GroupNumber == "39_26_4"] <- 39
data$GroupNumber[data$GroupNumber == "40_26_4"] <- 40
data$SubjectID_left <- as.character(data$SubjectID_left)
data$SubjectID_right <- as.character(data$SubjectID_right)
data$SubjectID_left[data$SubjectID_left == "steph"] <- "stephanie"
data$SubjectID_right[data$SubjectID_right == "Emil"] <- "emil"
data$SubjectID_right[data$SubjectID_right == "Sebber"] <- "seb"
data$SubjectID_left[data$SubjectID_left == "signe"] <- "SigneR"
data$SubjectID_right[data$SubjectID_right == "karo"] <- "Karoline"
data$SubjectID_right[data$SubjectID_right == "tobias"] <- "Toby"
data$SubjectID_left[data$SubjectID_left == "Nina"] <- "nina"
data$SubjectID_right[data$SubjectID_right == "theasmom"] <- "Theasmom"
data$SubjectID_left[data$SubjectID_left == "emma"] <- "Emma"
data$SubjectID_right[data$SubjectID_right == "LasseKob"] <- "Lasse"
```
```{r}
tibble(unique(data$GroupNumber), data$Correct_joint)
```