Skip to contents

Top market share data frame

Usage

concstats_top_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 market share 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_top_df(test_df, "x")
#>   id   x
#> 3  3 0.4