Skip to contents

This function generate synthetic SEND data from real SEND data.

Usage

sanitize(
  path,
  where_to_save = NULL,
  recovery = FALSE,
  number = 1,
  write_xpt = TRUE,
  setcd = NULL,
  test_original = FALSE
)

Arguments

path

Mandatory
Path where real data/xpt files located, should be a directory that contains xpt files, one or multiple directory can be given.

where_to_save

mandatory
Where to save generated xpt files. Should be a directory.

recovery

optional
Whether recovery animal data should be generated. Default FALSE.
If FALSE, no recovery animal data will be generated.

number

mandatory, default 1
How many studies to generate. Currently only work with 1

write_xpt

mandatory, boolean
Should write the file or not. If TRUE, then xpt file will be created.
Default is TRUE.

setcd

optional, vector
If there are more than one control or Low dose or High dose, function will give an error. User can choose which setcd should use. If recovery FALSE, then only provide c('1','2','3','4') setcd like this. But if recovery is TRUE, then also add setcd for recovery group c('1','2','3','4','1R','2R','3R','4R')

test_original

mandatory, boolean
This will print dataset that have original value and generated value. This is just comparison purpose. In RStudio IDE, you can see all the datasets and visually inspect.
default FALSE.

Examples

if (FALSE) {

# To generate one synthetic study dataset from one real study

SENDsanitizer::sanitize(path='path/to/directory/of/xpt/files/of/study/',
where_to_save='path/to/directory/where/generated/files/should/be/saved/')

# To generate one synthetic study dataset from multiple real studies

study_01 <- 'path/to/directory/of/xpt/files/of/study_01/'
study_02 <- 'path/to/directory/of/xpt/files/of/study_02/'
multiple_studies <- c(study_01,study_02)

SENDsanitizer::sanitize(path= multiple_studies,
where_to_save='path/to/directory/where/generated/files/should/be/saved/')

}