Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add legend onto the dtwclust plot? #2

Closed
Wang-Yu-Qing opened this issue Jun 3, 2016 · 3 comments
Closed

How to add legend onto the dtwclust plot? #2

Wang-Yu-Qing opened this issue Jun 3, 2016 · 3 comments

Comments

@Wang-Yu-Qing
Copy link

Wang-Yu-Qing commented Jun 3, 2016

After using the patitional clustering, I can't tell which series belongs to which clust from the plot result. If there is a legend or a table that shows each cluster and its members' name, it would be much easier. But how could i add such a legend or a table?

@asardaes
Copy link
Owner

asardaes commented Jun 3, 2016

I'm not sure adding such a legend is possible right now. However, if you want to identify cluster membership you could look at the cluster slot of the returned object:

data(uciCT)

kc <- dtwclust(CharTraj[1:10], k = 2,
               distance = "sbd", centroid = "pam",
               seed = 3247)

print(kc@cluster)
#> [1] 1 1 1 1 1 2 2 2 2 2

Would that help? The order corresponds to the data, so the first 5 series belong to cluster 1 and the last 5 series to cluster 2.

@Wang-Yu-Qing
Copy link
Author

Thank you very much. 'print(kc@cluster)' does help me !
I'm a beginner in R, so there would be lots of obstacles.Maybe i will ask for your help rather frequently.Is that OK for you?
Really appreciate your help! (^_^)

@asardaes
Copy link
Owner

asardaes commented Jun 5, 2016

I can help you with problems related to the package, although if you have questions of R in general I think there are better places where you can find lots of information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants