You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to modify the shc function to also handle Gower distances? Currently, shc only accepts numeric matrices, but Gower distances are calculated from a data frame with mixed column types, which is currently not possible as an input to shc. To illustrate:
> frame <- data.frame(var1=c(1,2,3,4,5,6),var2=c(0.1,0.2,0.3,0.4,0.5,0.6),var3=c("a","a","a","b","b","b"))
> frame$var3 <- as.factor(frame$var3)
> shc(frame,n_min = 3)
Error in shc(frame, n_min = 3) :
x must be a matrix; use as.matrix if necessary
> shc(as.matrix(frame),n_min = 3)
Error in colMeans(x) : 'x' must be numeric
In addition: Warning message:
In dist(x, method = metric, p = l) : NAs introduced by coercion
> shc(as.matrix(frame),n_min = 3,matmet = function(x){cluster::daisy(x,metric = "gower")})
Error in cluster::daisy(x, metric = "gower") :
x is not a dataframe or a numeric matrix.
Thank you in advance.
The text was updated successfully, but these errors were encountered:
Hello,
Would it be possible to modify the
shc
function to also handle Gower distances? Currently,shc
only accepts numeric matrices, but Gower distances are calculated from a data frame with mixed column types, which is currently not possible as an input toshc
. To illustrate:Thank you in advance.
The text was updated successfully, but these errors were encountered: