Description Usage Arguments Details Value Examples
View source: R/year_sector_data.R
year_sector_data
is the class used for the creation of tables
3.1, 4.1, 4.5, and 5.1 of the DCMS Sectors Economic Estimate
(https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/544103/DCMS_Sectors_Economic_Estimates_-_August_2016.pdf).
1 | year_sector_data(x, log_issues = FALSE)
|
x |
Input dataframe, see details. |
log_issues |
should issues with the data quality be logged to github?
See |
The year_sector_data
class expects a data.frame
with three
columns: sector, year, and measure, where measure is one of GVA, exports,
or enterprises. The data.frame
should include historical data, which
is used for checks on the quality of this year\'s data, and for producing
tables and plots.
Once inititated, the class has five slots: df
: the basic
data.frame
, colnames
: a character vector containing the
column names from the df
, type
: a character vector of
length(type) == 1
describing the type of data (\"GVA\", \"exports\",
or \"enterprises\") imputed from column names, sector_levels
: a
factor vector containing levels of df$sector
of the factor sector,
years
: an integer vector containing unique(df$year)
.
If the class is instantiated correctly, nothing is returned.
1 2 3 | library(eesectors)
GVA <- year_sector_data(GVA_by_sector_2016)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.