Description Usage Format Value Fields Methods Examples
Use object to query database table just like a data frame, using ...[x, y] notation.
1 2 3 4 | sto1 <- smalltableobject$new(...) # Named sql-table on db-server.
sto1[1:10, 1]
sto1[1, 1] <- 99 # Trigger a write to db.
sto1[, ] <- sto1[1:10, ] # NB: must use [,]
|
R6Class object with S3 class 'smalltableobject'.
Database table wrapped in an R6 object.
get_hostName of host
get_dbtypeType of DB. Only "sqlite" allowed, currently.
get_dbDatabase part of table schema.
get_tablenameTable part of table schema.
For full source code go to Github repo
subset_readDon't call directly. Used with overloaded operator. Public by neccessity.
subset_writeDon't call directly. Used with overloaded operator. Public by neccessity.
printPrints some helpful internal info about object. Also default method of object.
1 2 3 4 5 6 7 | tf <- tempfile()
cn <- RSQLite::dbConnect(RSQLite::SQLite(), tf)
DBI::dbWriteTable(cn, "mytab", cars)
DBI::dbDisconnect(cn)
sto1 <- smalltableobject$new(dbtype = "sqlite", host = tf, tablename = "mytab")
class(sto1)
sto1[1, 1]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.