[R-SIG-Finance] plotting market cap heatmap

Peter Carl peter at braverock.com
Mon Nov 2 19:24:41 CET 2009


These kinds of things are sometimes called "treemaps".  Take a look at the
'portfolio' package, particularly at the function called 'map.market'.

pcc
-- 
Peter Carl
http://www.braverock.com/~peter

> Hi,
>
> Let say I have this data frame.
>
>> tickers <- toupper(letters[1:5])
>> market.cap <- c(100, 60, 700, 1500, 450)
>> change <- c(0.02, 0.004, 0.0012, 0.001, 0.030
>> data <- data.frame(tickers, market.cap, change)
>> data
>   tickers market.cap change
> 1       A        100 0.0200
> 2       B         60 0.0040
> 3       C        700 0.0012
> 4       D       1500 0.0010
> 5       E        450 0.0300
>
> and I'd like to plot a heatmap whose market cap is proportional to the
> size of the cell, similar to http://finviz.com/map.ashx. Could
> somebody please give me a pointer? Thanks.
>
> -k
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



More information about the R-SIG-Finance mailing list