chavent / ClustOfVar

7 stars 4 forks source link

Function `hclustvar` is Not compatible with tibble #3

Open PenguinSmith opened 4 years ago

PenguinSmith commented 4 years ago

The function hclustvar will inspect its argument "X.quanti" and "X.quali" whether their type is the same as you indicated. However, the part of code related to type inspection is:

for (v in 1:ncol(X.quanti)) {
      if (!is.numeric(X.quanti[, v])) 
        stop("All variables in X.quanti must be numeric", 
          call. = FALSE)

if X.quanti is of type "tibble", X.quanti[,v] will be of type "tbl_df" "tbl" "data.frame", instead of the type of the column.

Actually I think hclustvar should seperate the dataframe by column type automatically.