Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Tal.Galili@gmail.com
user!2015 - The dendextend package
Tal.Galili@gmail.com
Talk outline
• Link to this presentation + dendextend
• 1 example
• The most useful functions
• Thank...
Tal.Galili@gmail.com
Getting
this presentation
Go to: www.R-statistics.com
Or: just e-mail me:
Tal.Galili@gmail.com
Getting
dendextend
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Further reading
Tal.Galili@gmail.com
Further reading
(1 example - no code)
Tal.Galili@gmail.com
The Iris dataset
Tal.Galili@gmail.com
The Iris dataset
Tal.Galili@gmail.com
The Iris dataset
Using heatmap.2 from gplots
Tal.Galili@gmail.com
Why is “complete” different?
Comparing 8
Clustering algorithms on
The Iris dataset
Using dendlist,
co...
Tal.Galili@gmail.com
Why is “complete” different?
Tal.Galili@gmail.com
Back to
basics
Tal.Galili@gmail.com
Building a
dendrogram
Tal.Galili@gmail.com
hclust -> dend
Tal.Galili@gmail.com
hclust -> dend
Tal.Galili@gmail.com
Useful functions
• labels
• labels_colors
• cutree
• color_branches
• sort
• tanglegram
• set (!)
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
2 useful
connections
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
https://plot.ly/~talgalili/ 6y/-sv-x/
Send a dendrogram to plot.ly
Tal.Galili@gmail.com
Send a dendrogram to d3heatmap
Joint work with Joe Cheng
Tal.Galili@gmail.com
Send a dendrogram to d3heatmap
http://asbcllc.com/blog/ 2015_abn/enuj/14_15_pot_50lmth.xedni/pamtaeh_
Tal.Galili@gmail.com
ONE more
function
Tal.Galili@gmail.com
Using pipes
%>%
(but first…)
Tal.Galili@gmail.com
hclust -> dend
Tal.Galili@gmail.com
hclust + pipes (via magrittr)
Tal.Galili@gmail.com
Changing a
dendrogram
Tal.Galili@gmail.com
The set function
set(dend, what, value)
One function
to rule them all!
Tal.Galili@gmail.com
The set function
set(dend, what, value)
• dend a dendrogram
• what the property to update
• value new...
Tal.Galili@gmail.com
The set function
set(dend, what, value)
Type “what"
Labels labels, labels_to_character, labels_colors...
Tal.Galili@gmail.com
A dend exmaple
Tal.Galili@gmail.com
Modify labels
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Modify nodes (no code)
Tal.Galili@gmail.com
Modify nodes (no code)
Tal.Galili@gmail.com
Modify branches
Tal.Galili@gmail.com
Modify branches
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Rotate branches
Tal.Galili@gmail.com
Rotate branches
Tal.Galili@gmail.com
Prune branches
Tal.Galili@gmail.com
Prune branches
Tal.Galili@gmail.com
Add rectangles
Tal.Galili@gmail.com
Add rectangles
Tal.Galili@gmail.com
dendextend
and other packages
Tal.Galili@gmail.com
Gplots: heatmap.2
Tal.Galili@gmail.com
dynamicTreeCut
Tal.Galili@gmail.com
pvclust
Tal.Galili@gmail.com
Take-home messages:
• hclust – is good for creating hierarchical
clustering, but limited for plotting...
Tal.Galili@gmail.com
Credits!
dendextend
This work was supported in part by the European Research Council under EC–EP7
Eur...
Tal.Galili@gmail.com
Credits!
Tal.Galili@gmail.com
The dendextend package
Thank you!
for the slides:
R-statistics.com
Tal.Galili@gmail.com
Exploring a
dendrogram
Tal.Galili@gmail.com
Tal.Galili@gmail.com
A dendrogram is a nested list of lists
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Tal.Galili@gmail.com
Depth-
First
Search
Tal.Galili@gmail.com
Depth-
First
Search
Tal.Galili@gmail.com
Comparing
dendrograms
Tal.Galili@gmail.com
tanglegram + untangle
Tal.Galili@gmail.com
tanglegram + untangle
Tal.Galili@gmail.com
“Correlation” measures
Tal.Galili@gmail.com
“Correlation” measures
Tal.Galili@gmail.com
dendextend
in the wild
Tal.Galili@gmail.com
Visually comparing two clustering methods
Tal.Galili@gmail.com
A plot from a recent HBP meeting in Lausanne
Dendrogram
Using 2
variables
Dendrogram
Using all
variab...
Tal.Galili@gmail.com
Visually comparing two phylogenic trees
Tal.Galili@gmail.com
Send a dendrogram to d3heatmap
http://asbcllc.com/blog/ 2015_abn/enuj/14_15_pot_50lmth.xedni/pamtaeh_
Tal.Galili@gmail.com
The dendextend package
Thank you!
for the slides:
R-statistics.com
Upcoming SlideShare
Loading in …5
×

2015 06-27 use-r2015_dendextend_tal_galili_01

51,232 views

Published on

A useR!2015 presentation about dendextend

Published in: Data & Analytics
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

2015 06-27 use-r2015_dendextend_tal_galili_01

  1. 1. Tal.Galili@gmail.com user!2015 - The dendextend package
  2. 2. Tal.Galili@gmail.com Talk outline • Link to this presentation + dendextend • 1 example • The most useful functions • Thanks!
  3. 3. Tal.Galili@gmail.com Getting this presentation Go to: www.R-statistics.com Or: just e-mail me:
  4. 4. Tal.Galili@gmail.com Getting dendextend
  5. 5. Tal.Galili@gmail.com
  6. 6. Tal.Galili@gmail.com Further reading
  7. 7. Tal.Galili@gmail.com Further reading (1 example - no code)
  8. 8. Tal.Galili@gmail.com The Iris dataset
  9. 9. Tal.Galili@gmail.com The Iris dataset
  10. 10. Tal.Galili@gmail.com The Iris dataset Using heatmap.2 from gplots
  11. 11. Tal.Galili@gmail.com Why is “complete” different? Comparing 8 Clustering algorithms on The Iris dataset Using dendlist, cor.dendlist + The corrplot package
  12. 12. Tal.Galili@gmail.com Why is “complete” different?
  13. 13. Tal.Galili@gmail.com Back to basics
  14. 14. Tal.Galili@gmail.com Building a dendrogram
  15. 15. Tal.Galili@gmail.com hclust -> dend
  16. 16. Tal.Galili@gmail.com hclust -> dend
  17. 17. Tal.Galili@gmail.com Useful functions • labels • labels_colors • cutree • color_branches • sort • tanglegram • set (!)
  18. 18. Tal.Galili@gmail.com
  19. 19. Tal.Galili@gmail.com
  20. 20. Tal.Galili@gmail.com
  21. 21. Tal.Galili@gmail.com
  22. 22. Tal.Galili@gmail.com
  23. 23. Tal.Galili@gmail.com
  24. 24. Tal.Galili@gmail.com
  25. 25. Tal.Galili@gmail.com
  26. 26. Tal.Galili@gmail.com
  27. 27. Tal.Galili@gmail.com 2 useful connections
  28. 28. Tal.Galili@gmail.com
  29. 29. Tal.Galili@gmail.com
  30. 30. Tal.Galili@gmail.com https://plot.ly/~talgalili/ 6y/-sv-x/ Send a dendrogram to plot.ly
  31. 31. Tal.Galili@gmail.com Send a dendrogram to d3heatmap Joint work with Joe Cheng
  32. 32. Tal.Galili@gmail.com Send a dendrogram to d3heatmap http://asbcllc.com/blog/ 2015_abn/enuj/14_15_pot_50lmth.xedni/pamtaeh_
  33. 33. Tal.Galili@gmail.com ONE more function
  34. 34. Tal.Galili@gmail.com Using pipes %>% (but first…)
  35. 35. Tal.Galili@gmail.com hclust -> dend
  36. 36. Tal.Galili@gmail.com hclust + pipes (via magrittr)
  37. 37. Tal.Galili@gmail.com Changing a dendrogram
  38. 38. Tal.Galili@gmail.com The set function set(dend, what, value) One function to rule them all!
  39. 39. Tal.Galili@gmail.com The set function set(dend, what, value) • dend a dendrogram • what the property to update • value new values to set in the tree
  40. 40. Tal.Galili@gmail.com The set function set(dend, what, value) Type “what" Labels labels, labels_to_character, labels_colors, labels_cex, labels_to_character Leaves leaves_pch, leaves_col, leaves_cex, hang_leaves Nodes nodes_pch, nodes_col, nodes_cex Branches branches_lty, branches_col, branches_lwd, branches_k_color, by_labels_branches_lty, by_labels_branches_col, by_labels_branches_lwd
  41. 41. Tal.Galili@gmail.com A dend exmaple
  42. 42. Tal.Galili@gmail.com Modify labels
  43. 43. Tal.Galili@gmail.com
  44. 44. Tal.Galili@gmail.com
  45. 45. Tal.Galili@gmail.com
  46. 46. Tal.Galili@gmail.com
  47. 47. Tal.Galili@gmail.com Modify nodes (no code)
  48. 48. Tal.Galili@gmail.com Modify nodes (no code)
  49. 49. Tal.Galili@gmail.com Modify branches
  50. 50. Tal.Galili@gmail.com Modify branches
  51. 51. Tal.Galili@gmail.com
  52. 52. Tal.Galili@gmail.com
  53. 53. Tal.Galili@gmail.com
  54. 54. Tal.Galili@gmail.com Rotate branches
  55. 55. Tal.Galili@gmail.com Rotate branches
  56. 56. Tal.Galili@gmail.com Prune branches
  57. 57. Tal.Galili@gmail.com Prune branches
  58. 58. Tal.Galili@gmail.com Add rectangles
  59. 59. Tal.Galili@gmail.com Add rectangles
  60. 60. Tal.Galili@gmail.com dendextend and other packages
  61. 61. Tal.Galili@gmail.com Gplots: heatmap.2
  62. 62. Tal.Galili@gmail.com dynamicTreeCut
  63. 63. Tal.Galili@gmail.com pvclust
  64. 64. Tal.Galili@gmail.com Take-home messages: • hclust – is good for creating hierarchical clustering, but limited for plotting • dendrogram object • a nested list of lists • with attributes! • should be modified step by step before plotting • Dendrograms can be compared • Use dendextendRcpp for (“free”) speed
  65. 65. Tal.Galili@gmail.com Credits! dendextend This work was supported in part by the European Research Council under EC–EP7 European Research Council grant PSARPS-297519, and also by the HBP project.
  66. 66. Tal.Galili@gmail.com Credits!
  67. 67. Tal.Galili@gmail.com The dendextend package Thank you! for the slides: R-statistics.com
  68. 68. Tal.Galili@gmail.com Exploring a dendrogram
  69. 69. Tal.Galili@gmail.com
  70. 70. Tal.Galili@gmail.com A dendrogram is a nested list of lists
  71. 71. Tal.Galili@gmail.com
  72. 72. Tal.Galili@gmail.com
  73. 73. Tal.Galili@gmail.com Depth- First Search
  74. 74. Tal.Galili@gmail.com Depth- First Search
  75. 75. Tal.Galili@gmail.com Comparing dendrograms
  76. 76. Tal.Galili@gmail.com tanglegram + untangle
  77. 77. Tal.Galili@gmail.com tanglegram + untangle
  78. 78. Tal.Galili@gmail.com “Correlation” measures
  79. 79. Tal.Galili@gmail.com “Correlation” measures
  80. 80. Tal.Galili@gmail.com dendextend in the wild
  81. 81. Tal.Galili@gmail.com Visually comparing two clustering methods
  82. 82. Tal.Galili@gmail.com A plot from a recent HBP meeting in Lausanne Dendrogram Using 2 variables Dendrogram Using all variables
  83. 83. Tal.Galili@gmail.com Visually comparing two phylogenic trees
  84. 84. Tal.Galili@gmail.com Send a dendrogram to d3heatmap http://asbcllc.com/blog/ 2015_abn/enuj/14_15_pot_50lmth.xedni/pamtaeh_
  85. 85. Tal.Galili@gmail.com The dendextend package Thank you! for the slides: R-statistics.com

×