dimmaker: Specify dimension for an Episteme API query

Description Usage Arguments Value Examples

View source: R/agnitio.R View source: R/dimensions.R

Description

Takes a data frame of names and codes along a dimension and specifies them ready for an Emsi Episteme data pull.

Usage

1
dimmaker(dimension, mapping)

Arguments

dimension

A named dimension required by the dataset being used for analysis (e.g. "Occupation").

mapping

This may take the form of the atomic "asIdentity" if all possible individual items are required with no relabelling, or else a data frame with two columns: name sets labels for code which refers to the geographic, industry, occupation or other codes used to categorise data within Episteme. Where one label is used for multiple codes, dimmaker will merge them to form a hybrid category.

If you want to pass a map with multiple codes to some of the labels, use a tibble with a list column for code and then pass each label a sequence of the form c("1211", "1212").

Value

A prepared list identifying the dimension and supporting mapping, ready to organise a data pull query.

Examples

1
2
3
4
5
mgrs <- data.frame(names=c("CEOs",
                           rep("Group of managers A",3),
                           rep("Group of managers B",4)),
                   codes=c("1115","1116","1121","1122","1123","1131","1132","1133"))
occs <- dimmaker("Occupation", mgrs)

dncnbrn/EmsiR documentation built on May 14, 2019, 10:33 a.m.