View source: R/write_secuTrial.R
write_secuTrial | R Documentation |
Convert the export prepared in R and export it to SPSS (sav), Stata (dta) or SAS (sas, xpt version 8) using the haven package.
write_secuTrial(object, ...) ## S3 method for class 'secuTrialdata' write_secuTrial(object, format = "dta", metadata = FALSE, ...) ## S3 method for class 'data.frame' write_secuTrial(df, filename, path = "", format = "dta", ...)
object |
|
... |
further parameters |
format |
format in which to save the export (one of "dta", "sas", "sav", "xpt") |
metadata |
if TRUE then metadate files will also be written |
df |
a data.frame |
filename |
file name |
path |
directory where the files should be saved |
Due to variable naming limitations in other packages, date variables are
appended with _d (rather than _date), datetime/POSIX variables are appended
with _dt (rather than _datetime) and factors with _f (rather than _factor).
Further variable names may be altered in the conversion process.
For details please refer to the haven
documentation.
a list of filenames
# prepare path to example export export_location <- system.file("extdata", "sT_exports", "lnames", "s_export_CSV-xls_CTU05_long_ref_miss_en_utf8.zip", package = "secuTrialR") # load all export data sT_export <- read_secuTrial(data_dir = export_location) tdir <- tempdir() write_secuTrial(sT_export, format = "dta", path = tdir) list.files(tdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.