Learn R Programming

hhi (version 1.2.0)

plot_hhi: Plots a Herfindahl-Hirschman Index Time Series

Description

Generates a plot of a vector of Herfindahl-Hirschman Index (HHI) values over a period of time

Usage

plot_hhi(x, "t", "h")

Arguments

x

Name of the data frame

t

Name of the vector (variable) from the data frame, x, corresponding with a measure of time (year, month, etc.)

h

Name of the vector (variable) from the data frame, x, corresponding with the HHI values

Value

hhi.plot A plot of HHI values over time

Details

Allows for placing objects directly from working datasets (including, data frame, measure of time, and stored HHI values in quotes) into the function for intuitive usage. Function supports any measure of time.

References

Hirschman, Albert O. 1945. "National power and structure of foreign trade." Berkeley, CA: University of California Press.

Herfindahl, Orris Clemens. 1950. "Concentration in the steel industry." Ph.D. dissertation, Columbia University.

Rhoades, Stephen A. 1993. "The herfindahl-hirschman index." Federal Reserve Bulletin 79: 188.

Waggoner, Philip D. 2018. "The hhi Package: Streamlined Calculation and Visualization of Herfindahl-Hirschman Index Scores." Journal of Open Source Software 3(28), 828.

Examples

Run this code
# NOT RUN {
hhi <- c(45,60,50,100,94,15,88,200,215,68,
47,62,52,102,96,17,90,202,217,70)
year <- c(1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,
2000,2001,2002,2003,2004,2005,2006,2007,2008,2009)
data <- data.frame(hhi, year)
plot_hhi(data, "year", "hhi")
# }

Run the code above in your browser using DataLab