Configure functions | R Documentation |
These functions are used to configure the tcpl settings.
tcplConf(drvr = NULL, user = NULL, pass = NULL, host = NULL, db = NULL, ...)
tcplConfDefault()
tcplConfList(show.pass = FALSE)
tcplConfLoad(list.new = TRUE)
tcplConfReset()
tcplConfSave()
drvr |
Character of length 1, which database driver to use |
user |
Character of length 1, the database server username |
pass |
Character of length 1, the database server password |
host |
Character of length 1, the database server |
db |
Character of length 1, the name of the tcpl database |
... |
Additional arguments that should be passed to dbConnect function |
show.pass |
Logical, should the password be returned |
list.new |
Logical of length 1, should the new settings be printed? |
Currently, the tcpl package supports the "MySQL", "example", and "API" database drivers.
The settings can be stored in a configuration file to make the using the
package more user-friendly. To create the configuration file, the user must
first create a system environment variable ('TCPL_CONF') that points to to
the file. There is more information about system environment variables in
Startup
and Sys.getenv
. Briefly, the user
needs to modify the '.Renviron' file in their home directory. If the file
does not exist, create it, and add the following line:
TCPL_CONF=path/to/confFile.conf
Here 'path/to/confFile.conf' can be any path to a file. One suggestion would
be to include .tcplConf in the home directory, e.g. TCPL_CONF=~/.tcplConf.
Note, '~' may not indicate the home directory on every operating system.
Once the environment variable is added, the user can change the settings
using tcplConf
, then save the settings to the file given by the
TCPL_CONF environment variable running tcplConfSave()
.
tcplConf
changes options
to set the tcpl-specific options,
most importantly to configure the connection to the tcpl databases.
tcplConf
will only change non-null values, and can be used to
change a single value if needed.
tcplConfSave
modifies the configuration file to reflect the current
tcpl settings.
tcplConfList
lists the values assigned to the tcpl global options.
tcplConfLoad
updates the tcpl settings to reflect the current
configuration file.
tcplConfDefault
changes the options
to reflect the default
settings for the API connection, but does not alter the configuration file.
tcplConfReset
is used to generate the initial configuration script,
and can be used to reset or regenerate the configuration script by the user.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.