KHelse | R Documentation |
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.
dbname
Database filename.
dbtype
Database type of either Access or DuckDB
dbyear
Production year. Only relevant for DuckDB
dbconn
Database connection.
tblname
Table name to be created in the database.
tblvalue
Data to be inserted in the table tblname
.
Data must be in a data.frame
or data.table
format.
dbpath
Database path
conn
Create database connection. Default is TRUE
new()
Start connecting to the database.
KHelse$new( dbname = NULL, dbtype = "Access", dbyear = NULL, dbpath = FALSE, conn = TRUE )
dbname
Database filename.
dbtype
Database type eg. Access, SQLite, DuckDB etc.
dbyear
Production year. This arg only relevant to raw database in DuckDB
dbpath
Path to the database file
conn
Create database connection. Default is TRUE
\dontrun{ kh <- KHelse$new(file.path(getOption("orgdata.drive"), getOption("orgdata.folder.db"), getOption("orgdata.db"))) kh$dbname kh$db_close() kh$db_connect() }
db_connect()
Reconnect to the database when db_close
was used.
KHelse$db_connect()
db_write()
Write table to the database.
KHelse$db_write( name = NULL, value = NULL, write = FALSE, append = FALSE, field.types = NULL )
name
Table name to be created in the database.
value
The data to be inserted in the table.
write
Write a table to the database. It will overwrite the table if it already exists
append
Append the data to an existing table in the database
field.types
Type of data in specified column. Must be named as vector
db_read()
Read table and convert to data.table format
KHelse$db_read(name = NULL)
name
Table name to be created in the database.
db_remove_table()
Remove table in the database.
KHelse$db_remove_table(name = NULL)
name
Table name to be created in the database.
db_close()
Close connection to the database.
KHelse$db_close()
## ------------------------------------------------
## Method `KHelse$new`
## ------------------------------------------------
## Not run:
kh <- KHelse$new(file.path(getOption("orgdata.drive"),
getOption("orgdata.folder.db"),
getOption("orgdata.db")))
kh$dbname
kh$db_close()
kh$db_connect()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.