library(lme4)
library(here)
library(tidyverse)
library(stringr) # for parsing r string 
library(jsonlite) # for parsing r string 
library(ggiraphExtra)
library(plotrix)
library(lmerTest)
RT_data <- read_csv(here('data/processed_data/trimmed_RTdata.csv'))
#pref_data <- read_csv(here('data/processed_data/trimmed_prefdata.csv'))
similarity_data <- read_csv(here('data/processed_data/trimmed_similaritydata.csv'))
complexity_data <- read_csv(here('data/processed_data/trimmed_complexitydata.csv'))
demog_data <- read_csv(here('data/processed_data/trimmed_demogdata.csv'))
RT_data <- RT_data %>% 
  mutate(rt = rt + 500)

Raw RT in linear space

RT_data %>% 
  #filter(rt < 10000) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "everything") + 
  xlab("RT(ms)") 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

RT_data %>% 
  filter(rt < 10000) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "exclude RT > 10s") + 
  xlab("RT(ms)") + 
  scale_x_continuous(breaks = seq(0, 10000, 500))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

RT_data %>% 
  filter(rt < 5000) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "exclude RT > 5s") + 
  xlab("RT(ms)") +
  scale_x_continuous(breaks = seq(0, 10000, 500))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

RT_data %>% 
  filter(rt < 10000) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "everything") + 
  xlab("RT(ms)") + 
  facet_wrap(~trial_number)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

raw looking time on the first trial only

RT_data %>% 
  filter(trial_number == 1) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "First trial only") + 
  xlab("RT(ms)") 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

RT_data %>% 
  filter(trial_number == 1) %>% 
  filter(rt < 10000) %>% 
   ggplot(aes(x = rt)) + 
  geom_histogram() + 
  labs(title = "First trial only, exclude RT > 10s") + 
  xlab("RT(ms)") + 
  scale_x_continuous(breaks = seq(0, 10000, 500))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.