metricmaker: Specify metrics for an Agnitio API query

Description Usage Arguments Value Examples

View source: R/metrics.R

Description

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

Usage

1
metricmaker(metricdf, geoparent, along)

Arguments

metricdf

at minimum, a data frame with two columns: name sets out the names for the metrics on Agnitio and as sets out the labels given to those metrics. Where using derivative metrics (Location Quotients and Shift-Share), additional columns are required in the form of metrics to specify if they are "LQ" or "SS" and, for Shift-Share, a base column identifies the comparison metric for the year. A data frame may pass with only the name specified – metrics will be given the Agnitio name as a label.

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/EmsiAgnitio documentation built on March 25, 2021, 7:31 a.m.