Running ‘andersondarling_behaviour.r’ [0s/1s]
  Running ‘andersondarling_correctness.r’ [1s/2s]
  Running ‘andersondarling_errors.r’ [0s/0s]
  Running ‘andersondarling_warnings.r’ [0s/1s]
  Running ‘bartlett_behaviour.r’ [0s/1s]
  Running ‘bartlett_correctness.r’ [4s/7s]
  Running ‘bartlett_errors.r’ [0s/1s]
  Running ‘bartlett_warnings.r’ [0s/1s]
  Running ‘brownforsythe_behaviour.r’ [0s/1s]
  Running ‘brownforsythe_correctness.r’ [0s/1s]
  Running ‘brownforsythe_errors.r’ [0s/1s]
  Running ‘brownforsythe_warnings.r’ [0s/1s]
  Running ‘cor_pearson_behaviour.r’ [0s/1s]
  Running ‘cor_pearson_correctness.r’ [1s/2s]
  Running ‘cor_pearson_errors.r’ [0s/1s]
  Running ‘cor_pearson_warnings.r’ [0s/1s]
  Running ‘cosinor_behaviour.r’ [0s/1s]
  Running ‘cosinor_correctness.r’ [24s/37s]
  Running ‘cosinor_errors.r’ [0s/1s]
  Running ‘cosinor_warnings.r’ [0s/1s]
  Running ‘f_var_behaviour.r’ [0s/1s]
  Running ‘f_var_correctness.r’ [1s/2s]
  Running ‘f_var_errors.r’ [0s/1s]
  Running ‘f_var_warnings.r’ [0s/1s]
  Running ‘flignerkilleen_behaviour.r’ [0s/1s]
  Running ‘flignerkilleen_correctness.r’ [3s/5s]
  Running ‘flignerkilleen_errors.r’ [0s/1s]
  Running ‘flignerkilleen_warnings.r’ [0s/1s]
  Running ‘jarquebera_behaviour.r’ [0s/1s]
  Running ‘jarquebera_correctness.r’ [1s/2s]
  Running ‘jarquebera_errors.r’ [0s/1s]
  Running ‘jarquebera_warnings.r’ [0s/1s]
  Running ‘kolmogorovsmirnov_twosample_behavioiur.r’ [0s/1s]
  Running ‘kolmogorovsmirnov_twosample_correctness.r’ [8s/12s]
  Running ‘kolmogorovsmirnov_twosample_errors.r’ [0s/1s]
  Running ‘kolmogorovsmirnov_twosample_warnings.r’ [0s/1s]
  Running ‘kruskalwallis_behaviour.r’ [0s/1s]
  Running ‘kruskalwallis_correctness.r’ [3s/5s]
  Running ‘kruskalwallis_errors.r’ [0s/0s]
  Running ‘kruskalwallis_warnings.r’ [0s/1s]
  Running ‘levene_behaviour.r’ [0s/1s]
  Running ‘levene_correctness.r’ [0s/1s]
  Running ‘levene_errors.r’ [0s/1s]
  Running ‘levene_warnings.r’ [0s/1s]
  Running ‘oneway_equalvar_behaviour.r’ [0s/1s]
  Running ‘oneway_equalvar_correctness.r’ [6s/9s]
  Running ‘oneway_equalvar_errors.r’ [0s/1s]
  Running ‘oneway_equalvar_warnings.r’ [0s/1s]
  Running ‘oneway_welch_behaviour.r’ [0s/1s]
  Running ‘oneway_welch_correctness.r’ [4s/7s]
  Running ‘oneway_welch_errors.r’ [0s/1s]
  Running ‘oneway_welch_warnings.r’ [0s/1s]
  Running ‘t_equalvar_behaviour.r’ [0s/1s]
  Running ‘t_equalvar_correctness.r’ [2s/3s]
  Running ‘t_equalvar_errors.r’ [0s/1s]
  Running ‘t_equalvar_warnings.r’ [0s/1s]
  Running ‘t_onesample_behaviour.r’ [0s/1s]
  Running ‘t_onesample_correctness.r’ [1s/1s]
  Running ‘t_onesample_errors.r’ [0s/1s]
  Running ‘t_onesample_warnings.r’ [0s/1s]
  Running ‘t_paired_behaviour.r’ [0s/1s]
  Running ‘t_paired_correctness.r’ [1s/2s]
  Running ‘t_paired_errors.r’ [0s/1s]
  Running ‘t_paired_warnings.r’ [0s/1s]
  Running ‘t_welch_behaviour.r’ [0s/1s]
  Running ‘t_welch_correctness.r’ [1s/2s]
  Running ‘t_welch_errors.r’ [0s/1s]
  Running ‘t_welch_warnings.r’ [0s/1s]
  Running ‘waerden_behaviour.r’ [0s/1s]
  Running ‘waerden_correctness.r’ [3s/5s]
  Running ‘waerden_errors.r’ [0s/1s]
  Running ‘waerden_warnings.r’ [0s/1s]
  Running ‘wilcoxon_onesample_behaviour.r’ [0s/1s]
  Running ‘wilcoxon_onesample_correctness.r’ [3s/5s]
  Running ‘wilcoxon_onesample_errors.r’ [0s/1s]
  Running ‘wilcoxon_onesample_warnings.r’ [0s/1s]
  Running ‘wilcoxon_paired_behaviour.r’ [0s/1s]
  Running ‘wilcoxon_paired_correctness.r’ [3s/6s]
  Running ‘wilcoxon_paired_errors.r’ [0s/1s]
  Running ‘wilcoxon_paired_warnings.r’ [0s/1s]
  Running ‘wilcoxon_twosample_behaviour.r’ [0s/1s]
  Running ‘wilcoxon_twosample_correctness.r’ [9s/16s]
  Running ‘wilcoxon_twosample_errors.r’ [0s/1s]
  Running ‘wilcoxon_twosample_warnings.r’ [0s/1s]
Running the tests in ‘tests/brownforsythe_correctness.r’ failed.
Complete output:
  > library(matrixTests)
  > 
  > #--- functions -----------------------------------------------------------------
  > 
  > car_brownforsythe <- function(mat, groups) {
  +   if(is.vector(mat)) mat <- matrix(mat, nrow=1)
  + 
  +   bad <- is.na(groups)
  +   mat    <- mat[,!bad,drop=FALSE]
  +   groups <- groups[!bad]
  + 
  +   ot <- og <- dft <- dfr <- fst <- p <- numeric(nrow(mat))
  +   for(i in 1:nrow(mat)) {
  +     bad <- is.na(mat[i,])
  +     vec <- mat[i,!bad]
  +     grp <- factor(groups[!bad])
  + 
  +     res <- car::leveneTest(vec ~ grp, center="median")
  + 
  +     # if p-value is NA turn dfs to NA as well
  +     if(is.na(res[["Pr(>F)"]][1])) res[["Df"]] <- NA
  + 
  +     dft[i] <- res[["Df"]][1]
  +     dfr[i] <- res[["Df"]][2]
  +     fst[i] <- res[["F value"]][1]
  +     p[i]   <- res[["Pr(>F)"]][1]
  +     ot[i]  <- length(vec)
  +     og[i]  <- length(unique(grp))
  +   }
  + 
  +   data.frame(obs.tot=ot, obs.groups=og, df.between=dft, df.within=dfr,
  +              statistic=fst, pvalue=p
  +              )
  + }
  > 
  > 
  > #--- montecarlo ----------------------------------------------------------------
  > 
  > # two groups
  > x <- matrix(rnorm(10000), ncol=10)
  > g <- sample(letters[1:2], 6, replace=TRUE)
  > g <- sample(c("a", "a", "b", "b", g))  # ensure both groups have at least 2 obs
  > res1 <- car_brownforsythe(x, g)
  Error in loadNamespace(x) : there is no package called 'car'
  Calls: car_brownforsythe ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
  Execution halted
Running the tests in ‘tests/levene_correctness.r’ failed.
Complete output:
  > library(matrixTests)
  > 
  > #--- functions -----------------------------------------------------------------
  > 
  > car_levene <- function(mat, groups) {
  +   if(is.vector(mat)) mat <- matrix(mat, nrow=1)
  + 
  +   bad <- is.na(groups)
  +   mat    <- mat[,!bad,drop=FALSE]
  +   groups <- groups[!bad]
  + 
  +   ot <- og <- dft <- dfr <- fst <- p <- numeric(nrow(mat))
  +   for(i in 1:nrow(mat)) {
  +     bad <- is.na(mat[i,])
  +     vec <- mat[i,!bad]
  +     grp <- factor(groups[!bad])
  + 
  +     res <- car::leveneTest(vec ~ grp, center="mean")
  + 
  +     # if p-vallue is NA turn df to NA as well
  +     if(is.na(res[["Pr(>F)"]][1])) res[["Df"]] <- NA
  + 
  +     dft[i] <- res[["Df"]][1]
  +     dfr[i] <- res[["Df"]][2]
  +     fst[i] <- res[["F value"]][1]
  +     p[i]   <- res[["Pr(>F)"]][1]
  +     ot[i]  <- length(vec)
  +     og[i]  <- length(unique(grp))
  +   }
  + 
  +   data.frame(obs.tot=ot, obs.groups=og, df.between=dft, df.within=dfr,
  +              statistic=fst, pvalue=p
  +              )
  + }
  > 
  > 
  > #--- montecarlo ----------------------------------------------------------------
  > 
  > # two groups
  > x <- matrix(rnorm(10000), ncol=10)
  > g <- sample(letters[1:2], 6, replace=TRUE)
  > g <- sample(c("a", "a", "b", "b", g))  # ensure both groups have at least 2 obs
  > res1 <- car_levene(x, factor(g))
  Error in loadNamespace(x) : there is no package called 'car'
  Calls: car_levene ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
  Execution halted