Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance Clustermap in R

I found this very appealing chart about the performance of the S&P500 from the WSJ.:

http://s.wsj.net/public/resources/images/MI-CA398B_STOCK_G_20131230184809.jpg

I'm trying to recreate it in R but I have no idea how to best plot the data, eg

data<-data.frame(stock=c("A","B","C","D"),group=c(rep("Fin",2),rep("Ind",2)),Perf=rnorm(4,0,1),mvalue=abs(rnorm(4,100,50)))

Has anybody a idea how to recreate it (e.g. with ggplot2?) or has anybody ever done a similar plot? Thx in advance.

like image 830
rainer Avatar asked Mar 21 '23 21:03

rainer


1 Answers

treemapify is a ggplot2 solution, as you were hoping for.

https://github.com/wilkox/treemapify

And the results are beautiful & flexible - typical of ggplot2 and its extensions.

enter image description here

like image 189
cmo Avatar answered Mar 29 '23 10:03

cmo