Commit 19411811 authored by Bonte Bruno's avatar Bonte Bruno

first script

parent 87e5af9b
#load basic libraries for graphs
library(dplyr)
library(tidyr)
library(ggplot2)
library(stringr)
#set working directory where this source file is
setwd("/home/bonte/git/aiat")
#read datas from IAT-master
data <- read.table("data/Cooperation-bru-2019-01-24-17-15.txt",
sep=",",
dec= ".") %>%
tbl_df()
colnames(data) <- c("trial",
"round",
"category",
"item",
"error",
"reactionTime")
items <- list(c("compétition",
"gain",
"profit",
"winner",
"performance"),
c("coopération",
"équité",
"égalité",
"gentillesse",
"solidarité"),
c("je",
"soi",
"mon"),
c("autre",
"eux",
"pas moi"))
data %>%
mutate(category = recode_factor(category,
"A"= "Appropriation",
"P"= "Partage",
"1"= "Moi",
"2"= "PasMoi")) %>%
ggplot() +
geom_density(aes(x= reactionTime, color=category)) +
facet_wrap(~trial) +
ggsave("all-reaction-times.pdf")
data %>%
mutate(category = recode_factor(category,
"A"= "Appropriation",
"P"= "Partage",
"1"= "Moi",
"2"= "PasMoi")) %>%
mutate(trial=as.factor(trial)) %>%
ggplot() +
geom_density(aes(x= reactionTime, color=trial), size =1.5) +
ggsave("per-trial-reaction-times.pdf")
{"name":"Cooperation","showResult":"show","IATtype":"two","catA":{"label":"Appropriation","datalabel":"A","itemtype":"txt","items":["comp\u00e9tition","gain","profit","winner","performance"]},"catB":{"label":"Partage","datalabel":"P","itemtype":"txt","items":["coop\u00e9ration","\u00e9quit\u00e9","\u00e9galit\u00e9","gentillesse","solidarit\u00e9"]},"cat1":{"label":"Moi","datalabel":"1","itemtype":"txt","items":["je","soi","mon"]},"cat2":{"label":"Pas moi","datalabel":"2","itemtype":"txt","items":["autre","eux","pas moi"]}}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment