invalid type character for column using the daisy function in R

536 Views Asked by At
gower_dist <- daisy(vechiles[, -1],
                    metric = "gower",
                    type = list(logratio = 3))

I'm trying to run this function on my data set, but I keep getting invalid type character for column as an error, it's clear this error is caused due to some columns being non-numeric, but how do I fix this? I tried running a solution I found on a similar question on Stack Overflow.

df$drive <- as.factor(df$drive)

but this didn't seem to fix my problem. The same error kept popping up. Help would be appreciated. Thanks.

0

There are 0 best solutions below