[R-SIG-Finance] plotting market cap heatmap

Brian G. Peterson brian at braverock.com
Mon Nov 2 19:04:39 CET 2009


The only heatmap code I've used in R is based on correlations, usually 
paired with a dendogram.  I don't know if that code could be adapted. 

Maybe a question for r-help since this seems a bit more generally 
related to plotting things in R than the specifics of what you're plotting?

Regards,

   - Brian

Khanh Nguyen wrote:
> 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