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

https://gitlab.inria.fr/lyao/visinmotion
12 November 2025, 14:48:24 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • dd99681039060e6dcec83a378405faa3bc4527d3
    No releases to show
  • 121c391
  • /
  • Analysis_Scripts
  • /
  • 3b-analysis-time.R
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:bc1efef488af8682bbbcddae35206d81b5509e42
origin badgedirectory badge
swh:1:dir:80ec129a4c99986d066f19504df5478656e66f55
origin badgerevision badge
swh:1:rev:dd99681039060e6dcec83a378405faa3bc4527d3
origin badgesnapshot badge
swh:1:snp:1b67b118c50b09a22aa5a6838946dd243ab1552a

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
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: dd99681039060e6dcec83a378405faa3bc4527d3 authored by lyao on 09 December 2023, 20:43:19 UTC
readme updated
Tip revision: dd99681
3b-analysis-time.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/aggregated_per_percentage.csv"
time_table <- read.csv(filename)
filename_analysis <- "results/time_analysis"

### CI analysis

source("CI-Functions-Bonferroni.R")
mydata <- time_table

# order for the transpose
elements <- mydata
elements <- elements [ order(elements$participant_id, elements$speed_duration), ]
#
myvars <- c("participant_id", "speed_duration", "mean_time_taken")
elements <- elements [myvars]
#aggregating all cases per participant
statstable <- ddply(elements,
                    c("participant_id","speed_duration"),
                    summarise,
                    mean_time=mean(mean_time_taken)
)
elements <- statstable

#
elements <- reshape(elements, timevar="speed_duration", idvar=c("participant_id"), direction="wide")
colnames(elements) <- gsub("mean_time.", "", colnames(elements))

#############
# all elements analysis
#############

data <- elements

techniqueA <- bootstrapMeanCI(data[,speed_duration_ms[1]]) #0-static
techniqueB <- bootstrapMeanCI(data[,speed_duration_ms[2]]) #1-slow
techniqueC <- bootstrapMeanCI(data[,speed_duration_ms[3]]) #2-fast

analysisData <- c()
analysisData$name <- c(speed_duration_ms[3],speed_duration_ms[2],speed_duration_ms[1])
analysisData$pointEstimate <- c(techniqueC[1], techniqueB[1], techniqueA[1])
analysisData$ci.max <- c(techniqueC[3], techniqueB[3], techniqueA[3])
analysisData$ci.min <- c(techniqueC[2], techniqueB[2], techniqueA[2])

datatoprint <- data.frame(factor(analysisData$name),analysisData$pointEstimate, analysisData$ci.min, analysisData$ci.max)
colnames(datatoprint) <- c("speed", "mean_time", "lowerBound_CI", "upperBound_CI ") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot
tmp <- paste(filename_analysis, "means.csv", collapse="_")
write.csv(datatoprint, file=tmp)

## Code that should print chart
colnames(datatoprint) <- c("technique", "mean_time", "lowerBound_CI", "upperBound_CI ") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot
barChart(datatoprint,analysisData$name ,nbTechs = 3, ymin = 0, ymax = 5000, "", "")
ggsave("plots/time-means.pdf",device = pdf, width=5, height=2)



# CIs with adapted alpha value for multiple comparisons

diffAB = bootstrapMeanCI_corr(data[,speed_duration_ms[1]] - data[,speed_duration_ms[2]], 3) # 0-static - 1-slow
diffCB = bootstrapMeanCI_corr(data[,speed_duration_ms[3]] - data[,speed_duration_ms[2]], 3) # 2-fast - 1-slow
diffCA = bootstrapMeanCI_corr(data[,speed_duration_ms[3]] - data[,speed_duration_ms[1]], 3) # 2-fast - 0-static

analysisData <- c()
analysisData$name <- c(paste(speed_duration_ms[3], speed_duration_ms[1], sep=" - "), # 2-fast - 0-static
                       paste(speed_duration_ms[3], speed_duration_ms[2], sep=" - "), # 2-fast - 1-slow
                       paste(speed_duration_ms[1], speed_duration_ms[2], sep=" - ")) # 0-static - 1-slow
analysisData$pointEstimate <- c(diffCA[1], diffCB[1], diffAB[1])
analysisData$ci.max <- c(diffCA[3], diffCB[3], diffAB[3])
analysisData$ci.min <- c(diffCA[2], diffCB[2], diffAB[2])
analysisData$level <- c(diffCA[4], diffCB[4], diffAB[4])
analysisData$ci_corr.max <- c(diffCA[6], diffCB[6], diffAB[6])
analysisData$ci_corr.min <- c(diffCA[5], diffCB[5], diffAB[5])

datatoprint <- data.frame(factor(analysisData$name), analysisData$pointEstimate, analysisData$ci.max, analysisData$ci.min, analysisData$level, analysisData$ci_corr.max, analysisData$ci_corr.min)
colnames(datatoprint) <- c("current_speed", "mean_time", "upperBound_CI","lowerBound_CI", "corrected_CI", "upperBound_CI_corr", "lowerBound_CI_corr") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot
tmp <- paste(filename_analysis, "diffs.csv", collapse="_")
write.csv(datatoprint,file=tmp)

## Code that should print chart
colnames(datatoprint) <- c("technique", "mean_time", "lowerBound_CI", "upperBound_CI", "corrected_CI","lowerBound_CI_corr","upperBound_CI_corr") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot
barChart_corr(datatoprint, analysisData$name, nbTechs = 3, ymin = -1000, ymax = 1000, "", "")
ggsave("plots/time-diffs.pdf",device = pdf, width=5, height=2)

back to top

Software Heritage — Copyright (C) 2015–2025, 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