R Under development (unstable) (2023-11-06 r85483 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #require(RUnit) > > ################################## > # Check that RT are consistent > # A vector with rt==0 should have stop before rt=1000 > ################################## > > require(OPI) Loading required package: OPI Loading required package: Rfast Loading required package: Rcpp Loading required package: RcppZiggurat Loading required package: RcppParallel Attaching package: 'RcppParallel' The following object is masked from 'package:Rcpp': LdFlags Rfast: 2.0.9 ___ __ __ __ __ __ __ __ __ __ _ _ __ __ __ __ __ __ __ __ __ __ __ | __ __ __ __ | | __ __ __ __ _/ / \ | __ __ __ __ / /__ __ _ _ __ __\ | | | | | | / _ \ | | / / | | | | | | / / \ \ | | / / | | | | | | / / \ \ | | / / | |__ __ __ __| | | |__ __ __ __ / / \ \ | |__ __ __ __ _ / /__/\ | __ __ __ __| | __ __ __ __| / /__ _ __\ \ |_ __ __ __ _ | / ___ / | \ | | / _ _ _ _ _ _ \ | | \/ / / | |\ \ | | / / \ \ | | / / | | \ \ | | / / \ \ | | / / | | \ \ | | / / \ \ | | / / | | \ \__ __ _ | | / / \ \ _ __ __ __ _| | / / |_| \__ __ __\ |_| /_/ \_\ /_ __ __ __ ___| \/ team Loading required package: abind > > get_mean_dist<- function(rtData) + { + checkTrue(chooseOpi("SimHensonRT"), 'RT Henson sim is chosen') + checkEquals(NULL, opiClose()) + + SPEED = 3; + LEVEL = dbTocd(20,10000) + + e <- opiInitialize(type="C", A=NA, B=NA, cap=6, display=NULL, maxStim=10000/pi, rtData=rtData, rtFP=1:1600) + checkEquals(NULL, e) + + stim <- list(path=list(x=c(20,0), y=c(20,0)),sizes=(0.43), colors=("white"), levels=(LEVEL), speeds=c(SPEED)) + class(stim) <- "opiKineticStimulus" + + result <- opiPresent(stim, tt= list(c(0,40)), fpr=0, fnr=0) + + checkEquals(NULL, opiClose()) + + return(sqrt((result$x - 20)^2 + (result$y-20)^2)) + } > > > test.rt <- function() + { + + rtData1 <- as.data.frame(cbind(Rt=rep( 0, 100),Dist=rep(0, 100), Person=rep(0, 100))) + rtData2 <- as.data.frame(cbind(Rt=rep(1000, 100),Dist=rep(0, 100), Person=rep(0, 100))) + + d1 <- median(replicate(100, get_mean_dist(rtData1))) + d2 <- median(replicate(100, get_mean_dist(rtData2))) + + checkTrue(d1 < d2, "d1 (rt=0) should be less than d2 (rt=1000)") + } > > proc.time() user system elapsed 0.26 0.06 0.32