I have seen that other people have already had this type of problem but I do not understand how to solve it.
I am learning how to do hierarchical classifications but every time I put
I have this error message :
Error in `[.data.frame`(smp, , var) : undefined columns selected
Here is my entire little script :
smp <- read.csv2("smp2.csv",header=T) var <- c("age","n.enfant","scz.cons","dep.cons","grave.cons","rs","ed","dr") cah <- hclust(dist(t(scale(smp[,var]))),method="ward.D") #It does not work from here plot(cah,xlab="",ylab="",main="Classification hiérarchique") obj <- cor(smp[,var],use="pairwise.complete.obs") heatmap(obj,col=gray(seq(1,0,length=16)))
And here is a dropbox link to my data if you need : Dropbox - smp2.csv - Simplify your life
Thank you in advance, have a great week-end !