rename_mw_sectors | R Documentation |
The muscle work methodology in the MWTools
package
uses slightly different final demand sector names compared to the IEA
and the IEATools
package..
This function converts the MWTools
sector names to appropriate IEA sector names.
rename_mw_sectors(
.df,
sector_colname = MWTools::mw_constants$sector_col,
original_sector_names = c(MWTools::mw_sectors$agriculture_broad.sector,
MWTools::mw_sectors$transport_sector, MWTools::mw_sectors$services_broad.sector,
MWTools::mw_sectors$industry_broad.sector),
new_sector_names = c(IEATools::other_flows$agriculture_forestry,
IEATools::transport_flows$transport_not_elsewhere_specified,
IEATools::other_flows$commercial_and_public_services,
IEATools::industry_flows$industry_not_elsewhere_specified)
)
.df |
A data frame of muscle work data. |
sector_colname |
The name of the sector column.
Default is |
original_sector_names |
A vector of string sector names that will be replaced. |
new_sector_names |
A vector of string sector names that will appear in output. |
A data frame with renamed sectors.
df <- tibble::tribble(~Sector, ~value,
MWTools::mw_sectors$transport_sector, 10,
MWTools::mw_sectors$agriculture_broad.sector, 11,
MWTools::mw_sectors$services_broad.sector, 12,
MWTools::mw_sectors$industry_broad.sector, 13,
"bogus", 14)
df
rename_mw_sectors(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.