metricmaker: Specify metrics for an Episteme API query

Description Usage Arguments Value Examples

View source: R/agnitio.R View source: R/metrics.R

Description

Takes a data frame of required metrics and necessary supporting criteria and specifies them ready for an Emsi Episteme data pull.

Usage

1
metricmaker(metricdf, geoparent, along)

Arguments

metricdf

at minimum, a data frame with two columns: name sets out the desired names for the metrics and as sets out the titles of the codes on Emsi Episteme. Where using derivative metrics (Openings, Location Quotients and Shift-Share), additional columns are required in the form of metrics to specify if they are "OP", "LQ" or "SS" and, for Openings and Shift-Share, a base column identifies the comparison metric for the year.

geoparent

is required for derivative metrics, and is a geographical code identifing the parent geographical unit for analysis.

along

is required for derivative metrics, and reflects the intended domain for analysis (e.g. "Industry" or "Occupation").

Value

A prepared data frame which will be ready for inclusion in a data pull query.

Examples

1
2
3
4
met1 <- data.frame(names=c("Jobs.2016","Jobs.2022"), as=c("Jobs.2016","Jobs.2022"))
metricmaker(met1)
met2 <- data.frame(name=c("Jobs.2016","Jobs.2016","Jobs.2016"),as=c("Jobs16","LQ16","SS16"),metrics=c(NA,"LQ","SS"),base=c(NA,NA,"Jobs.2003"))
metricmaker(met2, "GB", "Occupation")

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