Skip to contents

Top 3 market shares data frame

Usage

concstats_top3_df(x, y, na.rm = TRUE)

Arguments

x

A data frame.

y

A non-negative vector of shares.

na.rm

A logical vector that indicates whether NA values should be excluded or not. Must be either TRUE or FALSE. The default is TRUE. If set to FALSE the computation yields NA if NA values are present.

Value

A data frame, which indicates an id or firm column and the top 3 market shares in decimal form.

Examples

# some data
id <- c(1, 2, 3, 4, 5)
x <- c(0.2, 0.25, 0.4, 0.1, 0.05)
test_df <- data.frame(id, x)

concstats_top3_df(test_df, "x")
#>   id    x
#> 3  3 0.40
#> 2  2 0.25
#> 1  1 0.20