eesectors

Functions for producing the Economic Estimates for DCMS Sectors

This package provides functions used in the creation of a Reproducible
Analytical Pipeline (RAP) for the Economic Estimates for DCMS sectors
publication.

See the
eesectorsmarkdown
repository for an example of implementing these functions in the context
of a Statistical First Release (SFR).

Installation

The package can then be installed using
devtools::install_github('DCMSstats/eesectors'). Some users may not be
able to use the devtools::install_github() commands as a result of
network security settings. If this is the case, eesectors can be
installed by downloading the zip of the
repository
and installing the package locally using
devtools::install_local(<path to zip file>).

Quick start

Extracting data from underlying spreadsheets

The data are provided to DCMS as spreadsheets provided by the Office for
National Statistics (ONS). Hence, the first set of functions in the
package are designed to extract the data from these spreadsheets, and
combine the data into a single dataset, ready to be checked, and
converted into tables and figures.

There are four extract_ functions:

extract_ABS_data

extract_DCMS_sectors

extract_GVA_data

extract_SIC91_data

extract_tourism_data

Note: that with the exception of extract_DCMS_sectors, the data
extracted by these functions is potentially disclosive, and should
therefore be handled with care and considered to be OFFICIAL-SENSITIVE.
Steps must be taken to prevent the accidental disclosure of these
data.

Automated checking

The GVA chapter is built around the year_sector_data class. To create
a year_sector_data object, a data.frame must be passed to it which
contains all the data required to produce the tables and charts in
Chapter three.

An example of how this dataset will need to look is bundled with the
package: GVA_by_sector_2016. These data were extracted directly from
the 2016 SFR which is in the public domain, and provide a test case for
evaluating the data.

Any failed checks are raised as warnings, not errors, and so the user is
able to continue. However it is also possible to log these warnings as
github issues by setting log_issues=TRUE. This is a prototype feature
that needs additional work to increase the usefulness of these issues,
see below for details on environmental variables that are required for
this functionality to work.

Creating tables and charts

Tables and charts for Chapter three can be reproduced simply by running
the relevant functions: