From 4555878ff9f0fb355f85cae29496deaa45cfb594 Mon Sep 17 00:00:00 2001 From: Sergey Kucheryavskiy Date: Fri, 2 Aug 2024 09:32:50 +0200 Subject: [PATCH] added df to matrix conversion to prepCalData method --- R/misc.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/misc.R b/R/misc.R index d50ee40..705d85d 100755 --- a/R/misc.R +++ b/R/misc.R @@ -844,5 +844,11 @@ prepCalData <- function(x, exclrows = NULL, exclcols = NULL, min.nrows = 1, min. stop(sprintf("Dataset should contain at least %d variables (columns).", min.ncols)) } + if (is.data.frame((x))) { + nvar <- ncol(x) + x <- mda.df2mat(x) + stopifnot("The provided data frame has non-numeric columns, convert them to the numbers first." = ncol(x) == nvar) + } + return(x) }