I want to use ordinal data (1,2,3,4) of 59 observables with 322 variables and daisy, eventually leading to a cluster analysis. I use the script below on an excel input file (csv). After daisy, the following error message occurs:
> Error in daisy(grb, stand = TRUE) : ungültiger Typ character für
> Spaltennummern 1 In addition: Warning messages: 1: In data.matrix(x) :
> NAs introduced by coercion 2: In daisy(grb, stand = TRUE) :
> Binärvariable 2, 3, 4,
The grb data contain the row names in the first column, and the column titles in the first line. daisy seems to think it has to use the first column: How can I tell it no to do that? The input data look ok.
Secondly, daisy thinks the data a binaries, but they are oridnals, 1-4. How to correct this? Any help is greatly appreciated.
Script:
library(readr)
grb <- read_delim("~/R/Projects/Datasets/Ges.csv",
";", escape_double = FALSE, trim_ws = TRUE)
attach(grb)
library(cluster)
data(grb)
head(grb, 2)
d.d <- daisy(grb, stand = TRUE)
grb.hc <- hclust(d.d, method = "ward.D2")
library("factoextra")
fviz_dend(grb.hc, cex=.5, horiz = TRUE)