load.tables: Load tables from an export and distinguish between...

Description Usage Arguments Value References See Also Examples

View source: R/loading.R

Description

If is.rt is TRUE then only the decode.rt.visitlabels and silent parameters are used. If is.rt is FALSE then all other parameters including silent are interpreted. The argument tables can handle four distinguished cases:

The optional pre-processing steps are: identification of date columns and conversion to objects of the class 'Date', conversion of unknown dates to NA and renaming of column names (remove '_' and capital letters, see new.names). The study specific date formats and unknown date strings are specified in load.study.options.

Usage

1
2
3
4
load.tables(data.dir, tables = "all", convert.dates = FALSE,
  convert.unknown.date.to.na = FALSE, rename.headers = FALSE,
  add.pat.id = TRUE, add.center = FALSE, silent = FALSE,
  is.rt = FALSE, add.id.name = NULL, decode.rt.visitlabels = TRUE)

Arguments

data.dir

location of the export directory (or zip file) containing the csv/xls files

tables

vector of tables to be loaded (if a table.list exists, the corresponding table names can be given)

convert.dates

identify and convert date columns

convert.unknown.date.to.na

convert unknown date strings (e.g 1900-01-01) to NA

rename.headers

rename column names

add.pat.id

adding study ID pat.id to the first column

add.center

adding center information

silent

hide output

is.rt

specifies if export is in rectangular table format

add.id.name

This string needs to be specified if your Add-ID name has been changed in the AdminTool Design setting

decode.rt.visitlabels

specifies whether to decode the visit labels in the rectangular table

Value

(Pre-processed) tables in tables as data frames

References

http://stackoverflow.com/questions/3640925/global-variable-in-r-function

See Also

read.DB.table, load.table.list (used in dossier-specific packages), load.study.options

Examples

1
2
3
4
5
## non rectangular table
load.tables(data.dir=system.file("extdata", "s_export_CSV-xls_BMD.zip", package = "secuTrial"))
## rectangular table
load.tables(system.file("extdata", "s_export_rt-CSV-xls_BMD.zip", package = "secuTrial"),
            decode.rt.visitlabels = TRUE)

SwissClinicalTrialOrganisation/DM_secuTrial_R documentation built on May 21, 2019, 10:16 a.m.