UKDemographicsProvider: UK ONS demographics

Description Super classes Methods

Description

UK ONS demographics

UK ONS demographics

Super classes

ukcovidtools::PassthroughFilesystemCache -> ukcovidtools::DataProvider -> UKDemographicsProvider

Methods

Public methods

Inherited methods

Method new()

Usage
UKDemographicsProvider$new(providerController, ...)

Method getDetailedDemographics()

get the full range of demographics data at most detailed resolution

Usage
UKDemographicsProvider$getDetailedDemographics(...)

Method getDemographicsWithEstimatedEthnicity()

Usage
UKDemographicsProvider$getDemographicsWithEstimatedEthnicity(...)

Method getIMDData()

Usage
UKDemographicsProvider$getIMDData(...)

Method getDemographicsMap()

LSOA & Scottish Data Zones

Usage
UKDemographicsProvider$getDemographicsMap(...)

Method getDemographicsForShape()

get demographics interpolated to a specific shape file and aggregated to a given set of age bands, with optionally combining genders

Usage
UKDemographicsProvider$getDemographicsForShape(
  mapId,
  outputShape = self$geog$getMap(mapId),
  outputVars = vars(code, name),
  ageBreaks = seq(5, 90, 5),
  combineGenders = FALSE
)
Arguments
mapId

= the mapId

outputShape

= the sf object containing the shapefile of the desired output which may be grouped by desired output

outputVars

= the desired output columns from the output shapefile enclosed by vars(...) (defaults to code and name)

ageBreaks

= where to cut age groups? e.g. c(15,65,80) (max 90)

combineGenders

= merge the genders


Method getDemographicsForCodeTypes()

Usage
UKDemographicsProvider$getDemographicsForCodeTypes(
  codeTypes,
  ageBreaks = seq(5, 90, 5),
  combineGenders = FALSE
)

Method getDemographicsFromWeightedMapping()

Usage
UKDemographicsProvider$getDemographicsFromWeightedMapping(
  mappingDf,
  fromCodeVar = "fromCode",
  toCodeVar = "toCode",
  outputCodeVar = "code",
  weightExpr = 1,
  ageBreaks = seq(5, 90, 5),
  combineGenders = FALSE
)

Method getSingleDigitDemographics()

Usage
UKDemographicsProvider$getSingleDigitDemographics(
  mappingDf,
  fromCodeVar = "fromCode",
  toCodeVar = "toCode",
  outputCodeVar = "code",
  weightExpr = 1,
  combineGenders = FALSE
)

Method transitiveClosureWeightedMap()

Usage
UKDemographicsProvider$transitiveClosureWeightedMap(
  df,
  codeVar = "code",
  codeTypeVar = "codeType",
  ...
)

Method findDemographics()

Usage
UKDemographicsProvider$findDemographics(
  df,
  codeVar = "code",
  codeTypeVar = "codeType",
  ageCatVar = "ageCat",
  genderVar = "gender",
  ...
)

Method clone()

The objects of this class are cloneable with this method.

Usage
UKDemographicsProvider$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


terminological/uk-covid-datatools documentation built on June 24, 2021, 8:16 p.m.