Skip to contents

Builds the specified system file creating the targets for R and other languages as well as the templates for performing simulations and estimations.

Usage

build_system(
  system_file = "system.txt",
  distribution = "automatic",
  perlcmd = "perl",
  output_directory = file.path(".", "output"),
  temporary_directory = file.path(".", "transient"),
  verbose = TRUE,
  ubiquity_app = FALSE,
  debug = TRUE
)

Arguments

system_file

name of the file defining the system in the ubiquity format (default = 'system.txt'), if the file does not exist a template will be created and compiled.

distribution

indicates weather you are using a 'package' or a 'stand alone' distribution of ubiquity. If set to 'automatic' the build script will first look to see if the ubiquity R package is installed. If it is installed it will use the package. Otherwise, it will assume a "sand alone" distribution.

perlcmd

system command to run perl ("perl")

output_directory

location to store analysis outputs (file.path(".", "output"))

temporary_directory

location to templates and otehr files after building the system (file.path(".", "transient"))

verbose

enable verbose messaging (TRUE)

ubiquity_app

set to TRUE when building the system to be used with the ubiquty App (FALSE)

debug

Boolean variable indicating if debugging information should be displayed (TRUE)

Value

initialized ubiquity system object

Examples

# \donttest{
fr = system_new(file_name        = "system.txt", 
                system_file      = "mab_pk", 
                overwrite        = TRUE, 
                output_directory = tempdir())
cfg = build_system(system_file  = file.path(tempdir(), "system.txt"),
      output_directory          = file.path(tempdir(), "output"),
      temporary_directory       = tempdir())
#> 
#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmprz
#> → ubiquity:     https://r.ubiquity.tools
#> → Distribution: package (2.0.4)
#> → Creating output directory
#> → Compiling C version of system
#> → Loading the shared C library
#>  System built
#>  To fetch a new analysis template use `system_fetch_template`
#>  For example:
#>    fr = system_fetch_template(cfg, template = "Simulation")
#>    fr = system_fetch_template(cfg, template = "Estimation")
# }