inst/testScripts/setup/00a.setup.R

library("R.utils");

package <- "aroma.seq";

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install extra packages, iff missing
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (!isPackageInstalled("R.menu")) {
  source("http://aroma-project.org/hbLite.R");
  hbLite("R.menu");
}


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Setup link to test scripts directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
path <- "testScripts/";
path <- Arguments$getReadablePath(path, mustExist=FALSE);
if (!isDirectory(path)) {
  pathT <- system.file("testScripts", package=package);
  pathT <- Arguments$getReadablePath(pathT);
  createLink(target=pathT);
}
path <- Arguments$getReadablePath(path);


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create a launch.R file
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
pathname <- "launch.R";
if (!isFile(pathname)) {
  code <- c(
    '# Usage: source("launch.R")',
    'if (interactive()) savehistory();',
    'library("R.menu");',
    'launchMenu("testScripts");'
  );
  cat(file=pathname, code, sep="\n");
}
pathname <- Arguments$getReadablePathname(pathname);
HenrikBengtsson/aroma.seq documentation built on Feb. 15, 2021, 2:21 a.m.