build_getpop_query: A helper function for building queries for get_pop

View source: R/build_getpop_query.R

build_getpop_queryR Documentation

A helper function for building queries for get_pop

Description

A helper function for building queries for get_pop

Usage

build_getpop_query(
  con,
  cols,
  pop_table,
  group_by,
  group_geo_type,
  select_geo_type,
  ages,
  years,
  genders,
  races,
  ...
)

Arguments

con

a database connection

cols

data.table A three column data.table that describes the colname and coltype and cat

pop_table

DBI::Id of the relevant database table

group_by

character vector of column types to group results by. Should use types passed in cols

group_geo_type

SQL defining how to handle geo type grouping (mostly for things computed on the fly from blocks)

select_geo_type

SQL defining how to select geo_id

ages

vector of the ages to subset by. Use "All" to not subset

years

vector of years to subset results. Use "All" to not subset

genders

vector of genders to subset by. Use "All" to not subset

races

Vector of races to subsey by. Use 'All' to not subset

...

other SQL commands specifying subsets

Details

This function does very little argument checking since it assumes its being run within get_population


PHSKC-APDE/rads documentation built on April 14, 2025, 10:47 a.m.