convert: Convert scdf to R code

View source: R/convert.R

convertR Documentation

Convert scdf to R code

Description

Converts an scdf object into R code that can be used to recreate the object.

Usage

convert(
  scdf,
  file = "",
  study_name = "study",
  case_name = "case",
  inline = FALSE,
  indent = 2,
  silent = FALSE
)

Arguments

scdf

A single-case data frame. See scdf() to learn about this format.

file

A filename for exporting the syntax. If an empty string (default), the syntax is not written to a file.

study_name

Character string. Name of the study object.

case_name

Character string. Name of the scdf objects.

inline

If TRUE, phase definition is in an online version.

indent

Integer. Indentation.

silent

If TRUE, syntax is not printed to the console.

Details

This function is useful for exporting scdf objects for sharing or documentation purposes. The generated R code can be sourced to recreate the original scdf object.

Value

Returns a string (invisible).

Author(s)

Juergen Wilbert

See Also

Other io-functions: read_scdf(), write_scdf()

Examples

filename <- tempfile()
convert(exampleABC, file = filename)
source(filename)
all.equal(study, exampleABC)
unlink(filename)

scan documentation built on April 1, 2026, 9:06 a.m.