View source: R/populate_template.R
populate_template | R Documentation |
This function accesses the API endpoints exposed by GLIS for the and populates an template data with the data for projects specified by the provided filter. By default, the output file is created in the current working directory, and is named dynamically from the values of the filter. Alternatively, the name of the target database can be provided by the user. Execution of the function will be stopped if the template cannot be found or the target (output) database already exists (unless overwrite=TRUE).
populate_template(
filters,
template_database,
target = NULL,
source = c("assessment", "creel"),
overwrite = FALSE,
prune_fn012 = FALSE,
verbose = TRUE,
verbose_sqlsave = FALSE
)
filters |
a named list of filters used to select the project(s) that will be inserted into the target database. |
template_database |
Character string. The path to the template database that will be copied and populated with data from GLIS. |
target |
The name of the target (output) database file. If no target is provide, a name will be built from the filter list. |
source |
|
overwrite |
|
prune_fn012 |
|
verbose |
|
verbose_sqlsave |
|
NOTE this functionality is provided to facilitate updating, correcting and augmenting projects in GLIS. Changes made to the downloaded data should be uploaded back into GLIS as soon as possible. Downloaded data is not intended for long-term storage or subsequent data analysis. Data analysis and reporting should always be completed using data fetched directly from the API.
Arthur Bonsall arthur.bonsall@ontario.ca
## Not run:
populate_template(
list(prj_cd = "LEA_IA17_097"), "Great_Lakes_Assessment_Template_5.accdb"
)
populate_template(
list(prj_cd = "LEA_IA23_SHA"), "Great_Lakes_Assessment_Template_5.accdb",
"IBHN_2023_GLAT5.accdb"
)
populate_template(
list(prj_cd = "LEA_IA22_093"), "Great_Lakes_Assessment_Template_5.accdb",
"LPBTW_093_2023.accdb",
prune_fn012 = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.