From 9d3f7c9fa45ea4bdb4be5f60103c951af57d5e44 Mon Sep 17 00:00:00 2001 From: Eva Hamrud <50098063+evaham1@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:20:54 +1100 Subject: [PATCH] rmove dist checking so can plot multiple dist metrics using internal perf function --- R/tune.mint.plsda.R | 4 ---- R/tune.mint.splsda.R | 11 +++++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/R/tune.mint.plsda.R b/R/tune.mint.plsda.R index bd6777cb..d73de6ee 100644 --- a/R/tune.mint.plsda.R +++ b/R/tune.mint.plsda.R @@ -178,10 +178,6 @@ tune.mint.plsda <- if(sum(apply(table(Y,study)==0,2,sum)>0) >0) warning("At least one study does not contain all the levels of the outcome Y. The MINT algorithm might not perform as expected.") - - #-- dist - dist = match.arg(dist) - #-- light.output if (!is.logical(light.output)) stop("'light.output' must be either TRUE or FALSE", call. = FALSE) diff --git a/R/tune.mint.splsda.R b/R/tune.mint.splsda.R index 01419a67..72813190 100644 --- a/R/tune.mint.splsda.R +++ b/R/tune.mint.splsda.R @@ -218,10 +218,6 @@ tune.mint.splsda <- if(sum(apply(table(Y,study)==0,2,sum)>0) >0) warning("At least one study does not contain all the levels of the outcome Y. The MINT algorithm might not perform as expected.") - - #-- dist - dist = match.arg(dist) - #-- light.output if (!is.logical(light.output)) stop("'light.output' must be either TRUE or FALSE", call. = FALSE) @@ -239,6 +235,13 @@ tune.mint.splsda <- } else { if (is.null(test.keepX) | length(test.keepX) == 1 | !is.numeric(test.keepX)) stop("'test.keepX' must be a numeric vector with more than two entries", call. = FALSE) + + #-- dist (for tune can only have one dist, for perf can have multiple) + dist = match.arg( + dist, + choices = c("max.dist", "centroids.dist", "mahalanobis.dist"), + several.ok = TRUE + ) #-- end checking --# #------------------#