Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 80ec129
  • /
  • 1-read-and-calculate_errors_time.R
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:33f91aebe6d3acf91efb5c190878c4d1f7c3f48b
directory badge
swh:1:dir:80ec129a4c99986d066f19504df5478656e66f55

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
1-read-and-calculate_errors_time.R
library(plyr)
library(dplyr)
library(MPDiR)
library(quickpsy)
library(fitdistrplus)
library(ggplot2)

# Global values for our conditions
speed_duration_ms <- c('0-static','1-slow','2-fast')
correct_answer <- c(18,32,43,0,58,72,83)


# set directory where script is
sourceDir <- dirname (rstudioapi::getActiveDocumentContext()$path) 
defaultpath <- sourceDir

#remove(list = ls())
print(defaultpath)
setwd(defaultpath)

# get all log files
setwd("exp-data/")
file_list <- list.files(pattern=".csv")
show(file_list)

if (exists ("allData")) { rm(allData) }

# basic loop that reads over participant files
# and computes normalized errors
for (file in file_list){

  print(file)
  
  dataFile <- read.csv(file)
  
  # collect all trials in order to calculate error rate, keep non training trials (trial > 0)
  tmp <- dataFile
  # tmp <- tmp [ which (tmp$study_id != 'Pilot'),] # not Pilot study_id ADD BACK FOR EXPERIMENT
  tmp <- tmp [ which (tmp$correct_answer != 0),] #no trial 0
  
  tmp$abs_error <- abs(tmp$given_answer-tmp$correct_answer) #absolute error
  tmp$true_error <- (tmp$given_answer-tmp$correct_answer) #true error

  if ( !exists("allData") ){
    allData <- tmp
  } else {
    allData <- rbind(allData,tmp)
  }
}

print(defaultpath)
setwd(defaultpath)
write.csv(allData, file="results/all_data.csv")





back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API