lastralab / ABISSMAL

Github repository for ABISSMAL behavioral tracking platform
https://lastralab.github.io/ABISSMAL/site/
Other
6 stars 2 forks source link

[R unit tests] Fix path and package installation #477

Open gsvidaurre opened 1 week ago

gsvidaurre commented 1 week ago

Fix the following:

  1. The path for unit testing needs to be generalized, ideally in the main script to run all unit tests
  2. The code to install packages if they're not already installed should updated to:

is_installed <- function(p) is.element(p, installed.packages()[,1])

invisible(lapply(1:length(X), function(x){ if(!is_installed(X[x])){ install.packages(X[x], repos = "http://lib.stat.cmu.edu/R/CRAN") } }))