run.bayesx: Run BayesX

Description Usage Arguments Details Value Author(s) Examples

View source: R/run.bayesx.R

Description

Run BayesX program files from R.

Usage

1
run.bayesx(prg = NULL, verbose = TRUE, ...)

Arguments

prg

a file path to a BayesX program file. If set to NULL, BayesX will start in batch mode.

verbose

should output be printed to the R console during runtime of BayesX.

...

further arguments to be passed to system.

Details

Function uses system to run BayesX within an R session.

Value

If a prg file is provided, the function returns a list containg information if BayesX was succesfully launched and how long the process was running.

Author(s)

Daniel Adler, Thomas Kneib, Stefan Lang, Nikolaus Umlauf, Achim Zeileis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
## create a temporary directory for this example
dir <- tempdir()
prg <- file.path(dir, "demo.prg")

## generate some data
set.seed(111)
n <- 200

## regressor
dat <- data.frame(x = runif(n, -3, 3))

## response
dat$y <- with(dat, 1.5 + sin(x) + rnorm(n, sd = 0.6))

## write data to dir
write.table(dat, file.path(dir, "data.raw"),
  quote = FALSE, row.names = FALSE)

## create the .prg file
writeLines("
bayesreg b
dataset d 
d.infile using data.raw
b.outfile = mcmc
b.regress y = x(psplinerw2,nrknots=20,degree=3), family=gaussian predict using d
b.getsample", prg)

## run the .prg file from R
run.bayesx(prg)

## End(Not run)

BayesXsrc documentation built on May 1, 2019, 10:11 p.m.