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
  • /
  • 2-aggregate.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:43ce2b6a08eb4ee3fa76e8751020798dcc07d39d
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 ...
2-aggregate.R
library(plyr)
library(dplyr)
library(MPDiR)
library(quickpsy)
library(fitdistrplus)
library(ggplot2)

source("1-read-and-calculate_errors_time.R") # to read global values


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

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

filename <- "results/all_data.csv"
dataFile <- read.csv(filename)

# aggregating all possible percentages per movement speed
  aggregatedstable <- ddply(dataFile,
                      c("participant_id","speed_duration"), 
                      summarise,
                      mean_abs_error=mean(abs_error),
                      mean_true_error=mean(true_error),
                      mean_time_taken=mean(time_taken_type_ms)
   )
  
write.csv(aggregatedstable, file="results/aggregated.csv")


##################################################################


# aggregating per movement speed but for each percentage seperately
aggregatedstable2 <- ddply(dataFile,
                          c("participant_id","speed_duration","correct_answer"), 
                          summarise,
                          mean_abs_error=mean(abs_error),
                          mean_true_error=mean(true_error),
                          mean_time_taken=mean(time_taken_type_ms)
)

write.csv(aggregatedstable2, file="results/aggregated_per_percentage.csv")


for(c in correct_answer){
  tmp <- aggregatedstable2 [which (aggregatedstable2$correct_answer == c),]
  tmp_file_name <- sprintf("results/aggregated_%d.csv", c)
  write.csv(tmp, file=tmp_file_name)
}

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