Create New DB Source
createNewDBSource.Rd
Creates a script for a new data source from a database connection and sets .Renviron variables. Only "mySql" databases are supported.
Usage
createNewDBSource(
dataSourceName,
datingType,
coordType,
mappingName,
dbName,
dbUser,
dbPassword,
dbHost,
dbPort,
tableName,
scriptFolder = "R",
rootFolder = ".",
isTest = FALSE
)
Arguments
- dataSourceName
(character) name of the new data source, something like "xyDBname", "14CSea", "CIMA", "IntChron", "LiVES". The name of the source must be contained exactly as a column name in the mapping file.
- datingType
(character) dating type for the database, e.g. "radiocarbon" or "expert"
- coordType
(character) coordinate type of latitude and longitude columns; one of "decimal degrees" (e.g. 40.446 or 79.982), "degrees decimal minutes" ("40° 26.767' N" or "79° 58.933' W"), "degrees minutes seconds" ("40° 26' 46” N" or "79° 58' 56” W")
- mappingName
(character) name of the mapping without file extension, e.g. "IsoMemo". The mapping (a .csv file) must be available under "inst/mapping/".
- dbName
(character) database name
- dbUser
(character) database user
- dbPassword
(character) database password
- dbHost
(character) database host
- dbPort
(character) database port
- tableName
name of the table containing the data
- scriptFolder
(character) place to store the scripts.
- rootFolder
(character) root folder of the package, usually containing .Renviron, DESCRIPTION, ...
- isTest
(logical) TRUE if automatic testing