I have 4 different dataframes of for different city's but with the same variables. I want to make a hierarchical cluster between the dataset of the for city's. I have tried this code to make a hierarchical cluster in R:
hc <- hclust(dist(df))
hcd <- as.dendrogram(hc)
But this code makes a dendrogram of one dataframe. What I want to do is to make a dendrogram between different city's, so I want to cluster the row's between different city's. I have searched a lot at the internet bit I couldn't found anything about it. Does anyone know how to solve this problem?
I have also tried to combine the dataset, but then it makes also clusters with the same city's. I want to make clusters between different city's
An example of my dataset is as follows:
I have 4 different dataframes of for different city's but with the same variables. I want to make a hierarchical cluster between the dataset of the for city's. I have tried this code to make a hierarchical cluster in R:
hc <- hclust(dist(df))
hcd <- as.dendrogram(hc)
But this code makes a dendrogram of one dataframe. What I want to do is to make a dendrogram between different city's, so I want to cluster the row's between different city's. I have searched a lot at the internet bit I couldn't found anything about it. Does anyone know how to solve this problem?
I have also tried to combine the dataset, but then it makes also clusters with the same city's. I want to make clusters between different city's
An example of my dataset is as follows:
      colname_city   col_1   col_2
[1,]  Amsterdam      0.2     0.3
[2,]  Rotterdam      0.3     0.5
[3,]  Den Haag       0.4     0.2
[4,]  Utrecht        0.2     0.1
[5,]  Amsterdam      0.1     0.5
[6,]  Rotterdam      0.2     0.5
[7,]  Rotterdam      0.4     0.4
[8,]  Utrecht        0.5     0.3
[9,]  Utrecht        0.5     0.5
[10,] Den Haag       0.6     0.3
 
     
    