Description Usage Arguments Value Examples
View source: R/create_shares.R
Compute Share of Outside Good
1 | compute_outside_share(df, mkt_share, market_id)
|
df |
Dataframe to work with |
mkt_share |
Variable containing product market shares, as a character string. |
market_id |
List of variables contaning market identifiers |
A dataframe with the variable outside_share added as a column.
1 2 3 4 5 6 | # Add Outside Share column to data
mkts <- create_markets(geog_id = "market_id", time_id = "year")
df <- mkt_share_from_sales(eurocars,
quantity = 'qty_sold',
population = 'population')
df2 <- compute_outside_share(df, mkt_share = 'mkt_share', market_id = mkts)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.