Description Usage Arguments Details Value Examples
Combines datasets exracted from the underlying spreadsheet using
the extract_XXX
functions. A notebook version of this function
(which may be easier to debug) can be downloaded using the
get_GV_combine()
function. Note that this function in its current
form will only work to reproduce the 2016 SFR, and requires adjustment to
generalise it over new years.
NOTE: THIS FUNCTION RELIES ON DATA WHICH ARE CLASSIFIED AS
OFFICIAL-SENSITIVE. THE OUTPUT OF THIS FUNCTION IS AGGREGATED, AND
PUBLICALLY AVAILABLE IN THE FINAL STATISTICAL RELEASE, HOWEVER CARE MUST BE
EXERCISED WHEN CREATING A PIPELINE INCLUDING THIS FUNCTION. IT IS HIGHLY
ADVISEABLE TO ENSURE THAT THE DATA WHICH ARE CREATED BY THE extract_
FUNCTIONS ARE NOT STORED IN A FOLDER WHICH IS A GITHUB REPOSITORY TO
MITIGATE AGAINST ACCIDENTAL COMMITTING OF OFFICIAL DATA TO GITHUB. TOOLS TO
FURTHER HELP MITIGATE THIS RISK ARE AVAILABLE AT
https://github.com/ukgovdatascience/dotfiles.
1 2 | combine_GVA(ABS = NULL, GVA = NULL, SIC91 = NULL,
DCMS_sectors = eesectors::DCMS_sectors, tourism = NULL)
|
ABS |
ABS data as extracted by |
GVA |
ABS data as extracted by |
SIC91 |
ABS data as extracted by |
DCMS_sectors |
ABS data as extracted by
|
tourism |
ABS data as extracted by |
The best way to understand what happens when you run this function
is to look at the inst/combine_GVA.Rmd
notebook, which can be
downloaded automatically using the get_GV_combine()
function, or by
visiting
https://github.com/ukgovdatascience/eesectors/blob/master/inst/combine_GVA.Rmd.
A brief explanation of what the function does here:
1. Remove SIC 91 data from ABS
and swap in values from SIC91
)
2. Duplicate the 2014 ABS
values to use for 2015 (2015 values not
being available - this may change in future years.). 2. Merge the
eesectors::DCMS_sectors
into ABS
to get the 2 digit SIC code.
3. Calculate sums across sectors and years. 4. Add in total UK GVA from
GVA
. 5. Match in tourism
data. 6. Add tourism
overlap.
7. Build the dataframe into a format that is expected by the
year_sector_data
class.
A data.frame
as expected by the year_sector_data
class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(eesectors)
input <- 'OFFICIAL_working_file_dcms_V13.xlsm'
combine_GVA(
ABS = eesectors::extract_ABS_data(input),
GVA = eesectors::extract_ABS_data(input),
SIC91 = eesectors::extract_ABS_data(input),
DCMS_sectors = eesectors::DCMS_sectors,
tourism = eesectors::extract_ABS_data(input)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.