| GeoTox | R Documentation |
Create a GeoTox object and connect to the underlying database.
GeoTox(dbname = tempfile(fileext = ".duckdb"), reset_seed = FALSE, ...)
get_con(GT)
dbname |
Database file name. Default is a temporary file. |
reset_seed |
Logical indicating whether to reset the user's global
|
... |
Additional arguments passed to |
GT |
GeoTox object. |
The dbname will point to a DuckDB database file. If the file does not
already exist, a new database will be created. Additional arguments passed
via ... will be forwarded to DBI::dbConnect().
The reset_seed parameter is necessary for replicating results from the
previous GeoTox implementation. Some database functions create temporary
tables where a random string is appended to the table name. This advances the
.Random.seed state and causes functions that use randomness to produce
different results between the previous and current implementations. Setting
reset_seed = TRUE will reset the user's .Random.seed to the value it had
before certain database operations.
Various parameters will be stored in the 'par' table. These parameters will
also be loaded into the GeoTox object as a list in GT$par. The value for
reset_seed can only be set on initial GeoTox object creation and will be
loaded from the 'par' table for existing databases.
For GeoTox(), a GeoTox S3 object. For get_con(), a database
connection.
# Create a GeoTox object
GT <- GeoTox()
# Open a connection to GeoTox database
con <- get_con(GT)
# List database tables
DBI::dbListTables(con)
# Look at the GT parameters
dplyr::tbl(con, "par") |> dplyr::collect()
str(GT$par)
# Clean up example
DBI::dbDisconnect(con)
file.remove(GT$db_info$dbdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.