dbImportStudies {sendigR} | R Documentation |
Import SEND study data in SAS xport format into a SEND database from a hierarchy study folders.
Description
For each non-empty folder below the specified root folder, the actions to import a set of SAS xpt files into the opened SQLlite database described for function dbImportOneStudy.
Usage
dbImportStudies(
dbToken,
xptPathRoot,
overWrite = FALSE,
checkRequiredVars = TRUE,
verbose = FALSE,
logFilePath = NULL
)
Arguments
dbToken |
Mandatory |
xptPathRoot |
Mandatory, character |
overWrite |
Mandatory, boolean |
checkRequiredVars |
Mandatory, boolean |
verbose |
Mandatory, boolean |
logFilePath |
Optional, character |
Details
The status for the processing of each sub folder is caught and returned as
described below.
If parameter verbose = TRUE
, the status for each processed sub folder
is also printed to the console each time a sub folder has been processed -
i.e. it's possible to followed the progress of the import process.
If parameter logFilePath
has been specified with an existing path to a
folder, the status for each processed sub folder is also printed to a log
file in this folder each time a sub folder has been processed.
The database must be an SQLite database - no other types of databases are supported by this function.
Value
A list containing a named element with the import status for each
of the processed sub folders.
Each of the statuses are one of three variants:
'OK' - the SAS xport files has been imported to the database with no errors or warnings
'Warning: [list of warnings]' - the SAS xport files has been imported to the database but have one or more warnings
'Cancelled: [error message]' - the SAS xport files have not been imported to the database because an error has been detected.
Examples
## Not run:
# Import studies from a set of folders - do not allow to overwrite
# existing study data in the database, follow the progress
dbImportStudies(myDbToken,'/mydatapath/studies', verbose = TRUE)
# Import studies from another set of folders - allow to overwrite existing
# study data in the database
dbImportStudies(myDbToken,'/mydatapath/project123/studies', overwrite = TRUE)
# Import studies from a set of folders , save the status of each study load
# in a log file
dbImportStudies(myDbToken,'/mydatapath/studies',
logFilePath = '/my/log file/path')
## End(Not run)