Harmonise and integrate data tables into standardised format

normTable(
  input = NULL,
  pattern = NULL,
  query = NULL,
  ontoMatch = NULL,
  beep = NULL,
  verbose = FALSE
)

Arguments

input

[character(1)]
path of the file to normalise. If this is left empty, all files at stage two as subset by pattern are chosen.

pattern

[character(1)]
an optional regular expression. Only dataset names which match the regular expression will be processed.

query

[character(1)]
the expression that would be used in filter to subset a tibble in terms of the columns defined via the schema and given as a single character string.

ontoMatch

[character(.)]
name of the column(s) that shall be matched with an ontology (defined in adb_init).

beep

[integerish(1)]
Number specifying what sound to be played to signal the user that a point of interaction is reached by the program, see beep.

verbose

[logical(1)]
be verbose about translating terms (default FALSE). Furthermore, you can use suppressMessages to make this function completely silent.

Value

This function harmonises and integrates so far unprocessed data tables at stage two into stage three of the areal database. It produces for each main polygon (e.g. nation) in the registered data tables a file that includes all thematic areal data.

Details

To normalise data tables, this function proceeds as follows:

  1. Read in input and extract initial metadata from the file name.

  2. Employ the function tabshiftr::reorganise to reshape input according to the respective schema description.

  3. The territorial names are matched with the gazetteer to harmonise new territorial names (at this step, the function might ask the user to edit the file 'matching.csv' to align new names with already harmonised names).

  4. Harmonise territorial unit names.

  5. store the processed data table at stage three.

See also

Other normalise functions: normGeometry()

Examples

if(dev.interactive()){
  # build the example database
  adb_example(until = "normGeometry", path = tempdir())

  # normalise all available data tables ...
  normTable()

  # ... and check the result
  output <- readRDS(paste0(tempdir(), "/tables/stage3/Estonia.rds"))
}