appendSectors: Append sector membership to APS data extract

Description Usage Arguments Details Value Examples

View source: R/appendSectors.R

Description

This function appends DCMS sector membership to an APS SPSS-extracted data frame.

Usage

1
appendSectors(x, sectors = eesectors::DCMS_sectors)

Arguments

x

a 'data.frame' as extracted by eesectors::extract_APS_data

sectors

a 'data.frame' as extracted by eesectors::extract_DCMS_sectors. This defaults to the 'DCMS_sectors' object which is the 'extract_DCMS_sectors' function applied to the 2016 data.

Details

The function eesectors::extract_APS_data extracts APS data from an APS SPSS file. This function appends DCMS sector membership to an APS SPSS-extracted data frame before further analysis, on a first job and second job basis

1. The function converts the character vector DCMS_sectors$SIC to double

2. The function loops through the sectors found in DCMS_sectors, and uses DCMS_sectors as a lookup for membership of each person's main and second job in each sector

3. The function adds membership in the form of two variables per sector

4. The dataframe with +2*n_sectors variables is returned

Value

The function returns the APS data as a dataframe with the sector membership variables appended

Examples

1
2
3
4
5
6
7
## Not run: 
library(eesectors)
APS_data_sectors=appendSectors(
x = APS_data
)

## End(Not run)

ukgovdatascience/eesectors documentation built on Sept. 11, 2020, 12:19 p.m.