Connect to registration database to get all necessary information
on data source and cleaning specification. The driver is only applicable
to an Access Database. Calling the method KHelse$new(YourFilePath)
will create an object of R6 Class. Please refer to the
examples.
Public fields
dbnameDatabase filename.
dbtypeDatabase type of either Access or DuckDB
dbyearProduction year. Only relevant for DuckDB
dbconnDatabase connection.
tblnameTable name to be created in the database.
tblvalueData to be inserted in the table
tblname. Data must be in adata.frameordata.tableformat.dbpathDatabase path
connCreate database connection. Default is
TRUE
Methods
Method new()
Start connecting to the database.
Usage
KHelse$new(
dbname = NULL,
dbtype = "Access",
dbyear = NULL,
dbpath = FALSE,
conn = TRUE
)Method db_write()
Write table to the database.
Usage
KHelse$db_write(
name = NULL,
value = NULL,
write = FALSE,
append = FALSE,
field.types = NULL
)Arguments
nameTable name to be created in the database.
valueThe data to be inserted in the table.
writeWrite a table to the database. It will overwrite the table if it already exists
appendAppend the data to an existing table in the database
field.typesType of data in specified column. Must be named as vector
Examples
## ------------------------------------------------
## Method `KHelse$new`
## ------------------------------------------------
if (FALSE) { # \dontrun{
kh <- KHelse$new(file.path(getOption("orgdata.drive"),
getOption("orgdata.folder.db"),
getOption("orgdata.db")))
kh$dbname
kh$db_close()
kh$db_connect()
} # }
