Skip to content

Commit

Permalink
added df to matrix conversion to prepCalData method
Browse files Browse the repository at this point in the history
  • Loading branch information
svkucheryavski committed Aug 2, 2024
1 parent f0396d6 commit 4555878
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 4555878

Please sign in to comment.