-
Notifications
You must be signed in to change notification settings - Fork 13
/
appendSectors.Rd
50 lines (43 loc) · 1.44 KB
/
appendSectors.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/appendSectors.R
\name{appendSectors}
\alias{appendSectors}
\title{Append sector membership to APS data extract}
\usage{
appendSectors(x, sectors = eesectors::DCMS_sectors)
}
\arguments{
\item{x}{a `data.frame` as extracted by \code{eesectors::extract_APS_data}}
\item{sectors}{a `data.frame` as extracted by
\code{eesectors::extract_DCMS_sectors}. This defaults to the `DCMS_sectors`
object which is the `extract_DCMS_sectors` function applied to the 2016
data.}
}
\value{
The function returns the APS data as a dataframe with the sector
membership variables appended
}
\description{
This function appends DCMS sector membership to an APS
SPSS-extracted data frame.
}
\details{
The function \code{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
}
\examples{
\dontrun{
library(eesectors)
APS_data_sectors=appendSectors(
x = APS_data
)
}
}