Harmonise and integrate data tables into standardised format
normTable(
input = NULL,
pattern = NULL,
query = NULL,
ontoMatch = NULL,
beep = NULL,
verbose = FALSE
)
character(1)
path of the file to normalise. If
this is left empty, all files at stage two as subset by pattern
are
chosen.
character(1)
an optional regular expression.
Only dataset names which match the regular expression will be processed.
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, such as
"al1 == 'Estonia'"
.
character(.)
name of the column(s) that
shall be matched with an ontology (defined in adb_init
).
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
.
logical(1)
be verbose about translating terms
(default FALSE
). Furthermore, you can use
suppressMessages
to make this function completely silent.
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.
To normalise data tables, this function proceeds as follows:
Read in input
and extract initial metadata from
the file name.
Employ the function
tabshiftr::reorganise
to reshape input
according to
the respective schema description.
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).
Harmonise territorial unit names.
store the processed data table at stage three.
Other normalise functions:
normGeometry()
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"))
}