Description Usage Arguments Details Value Examples
importData()
connects to a Food Co-op's SQLite database.
A query gives back the current turnover of the Food Co-op and writes the
result in a second database.
1 | importData(FROM, TO)
|
FROM |
the path to the backup database. |
TO |
a list containing 'nameTable' and 'path' of the second database = the database where the query shall be dropped |
The names of the character strings inside the list of parameter TO
need to be the same as they are writte above (or look at examples).
No value is returned but a table is written in the second database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #### load dataset ####
path <- system.file("data", package = "foodstorage")
files <- list.files(path)
# filter all backups (files which end up with .BAK)
backups <- files[which(stringr::str_detect(files, ".BAK$"))]
current_backup <- backups[length(backups)] # use newest backup
pathToBackup <- file.path(path, current_backup)
# test result of file.path -> if file doesn't exist, length(result) will be 0
kornInfoExists <- files[which(stringr::str_detect(files, "kornInfo.sqlite"))]
pathToKornInfo <- file.path(path, kornInfoExists)
# create list for parameter 'TO'
TO <- list(nameDB = "kornInfo.sqlite", nameTable = "kornumsatz_origin", path = pathToKornInfo)
importData(FROM = pathToBackup, TO = TO)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.