regTable {arealDB} | R Documentation |
Register a new areal data table
Description
This function registers a new areal data table into the geospatial database.
Usage
regTable(
...,
subset = NULL,
dSeries = NULL,
gSeries = NULL,
label = NULL,
begin = NULL,
end = NULL,
schema = NULL,
archive = NULL,
archiveLink = NULL,
nextUpdate = NULL,
updateFrequency = NULL,
metadataLink = NULL,
metadataPath = NULL,
notes = NULL,
update = FALSE,
overwrite = FALSE
)
Arguments
... |
[ |
subset |
[ |
dSeries |
[ |
gSeries |
[ |
label |
[ |
begin |
[ |
end |
[ |
schema |
[ |
archive |
[ |
archiveLink |
[ |
nextUpdate |
[ |
updateFrequency |
[ |
metadataLink |
[ |
metadataPath |
[ |
notes |
[ |
update |
[ |
overwrite |
[ |
Details
When processing areal data tables, carry out the following steps:
Determine the main territory (such as a nation, or any other polygon), a
subset
(if applicable), the ontologylabel
and the dataseries of the areal data and of the geometry, and provide them as arguments to this function.Provide a
begin
andend
date for the areal data.Run the function.
-
(Re)Save the table with the following properties:
Format: csv
Encoding: UTF-8
File name: What is provided as message by this function
make sure that the file is not modified or reshaped. This will happen during data normalisation via the schema description, which expects the original table.
Confirm that you have saved the file.
Every areal data dataseries (dSeries
) may come as a slight
permutation of a particular table arrangement. The function
normTable
expects internally a schema description (a list
that describes the position of the data components) for each data table,
which is saved as paste0("meta_", dSeries, TAB_NUMBER)
. See package
tabshiftr
.
Value
Returns a tibble of the entry that is appended to 'inv_tables.csv' in
case update = TRUE
.
See Also
Other register functions:
regDataseries()
,
regGeometry()
Examples
if(dev.interactive()){
# build the example database
makeExampleDB(until = "regGeometry", path = tempdir())
# the schema description for this table
library(tabshiftr)
schema_madeUp <-
setIDVar(name = "al1", columns = 1) %>%
setIDVar(name = "year", columns = 2) %>%
setIDVar(name = "commodities", columns = 3) %>%
setObsVar(name = "harvested",
factor = 1, columns = 4) %>%
setObsVar(name = "production",
factor = 1, columns = 5)
regTable(nation = "Estonia",
subset = "barleyMaize",
dSeries = "madeUp",
gSeries = "gadm",
level = 1,
begin = 1990,
end = 2017,
schema = schema_madeUp,
archive = "example_table.7z|example_table1.csv",
archiveLink = "...",
nextUpdate = "2019-10-01",
updateFrequency = "quarterly",
metadataLink = "...",
metadataPath = "my/local/path",
update = TRUE)
}