map.market: Create a Map of the Market

Description Usage Arguments Author(s) Examples

View source: R/map.market.R

Description

Utility function for creating a "map of the market" visualization. Creates a treemap where rectangular regions of different size, color, and groupings visualize the stocks in a portfolio.

Usage

1
2
3
4
5
map.market(id, area, group, color,
           scale = NULL,
           lab   = c("group"=TRUE, "id"=FALSE),
           main  = "Map of the Market",
           print = TRUE)

Arguments

id

A vector storing the labels to be used for each stock.

area

A vector storing the values to be used to calculate the areas of rectangles.

group

A vector specifying the group (i.e. country, sector, etc.) to which each stock belongs.

color

A vector storing the values to be used to calculate the color of rectangles.

scale

An object of class numeric indicating the scale to be used in determining colors.

lab

A logical vector of length 2 specifying whether group and stock labels should be drawn. If the two values are the same, the second may be omitted.

main

A title for the plot.

print

An object of class logical indicating whether the map should be drawn.

Author(s)

Jeff Enos jeff@kanecap.com

Examples

1
2
3
4
5
data(dow.jan.2005)
map.market(id    = dow.jan.2005$symbol,
           area  = dow.jan.2005$price,
           group = dow.jan.2005$sector,
           color = 100 * dow.jan.2005$month.ret)

portfolio documentation built on July 10, 2021, 5:08 p.m.