CrumpLab / psyc7709_2019

Course website for PSYC 7709 - Using R for Reproducible Research (taught by Matt Crump 2019)
https://crumplab.github.io/psyc7709_2019/
1 stars 7 forks source link

stimulus and response times format #12

Open rtroise89 opened 5 years ago

rtroise89 commented 5 years ago

Hi everyone, I've successfully made my flanker data frame using the text files (1 -22), but the stimulus and response times are appearing as "######e-312" indicating very small numbers. The original time numbers, in the text files, appear as large numbers so I'm thinking the template we were given for the assignment is somehow coercing the large numbers to small numbers? Maybe something to do with function 'fread'?

library(data.table)
library(dplyr)
library(ggplot2)

# get the file names
file_names <- list.files(path="FlankerData")

# create headers for each column
the_headers <- c("stimulus","congruency","proportion",
                 "block","condition","dualtask","unknown",
                 "stimulus_onset","response_time","response","subject")
# Load data
# create empty dataframe
all_data<-data.frame()

# loop to add each file to the dataframe
for(i in file_names){
  one_subject <- fread(paste("FlankerData/",i, sep=""))
  names(one_subject) <- the_headers
  one_subject$subject <- rep(i,dim(one_subject)[1])
  one_subject <- cbind(one_subject, trial= 1:dim(one_subject)[1])
  all_data <- rbind(all_data,one_subject)
}
CrumpLab commented 5 years ago

Not exactly sure why this is happening. Try installing and loading the bit64 package and see if that helps.