batch: Batch Execution

Description Usage Arguments Details Value Examples

View source: R/batch.r

Description

Run a local script on a remote server in batch. Similar to R's own source() function.

Usage

1
2
batch(addr = "localhost", port = 55555, password = NULL, file,
  script, timer = FALSE, serialversion = NULL)

Arguments

addr

The remote host/address/endpoint.

port

The port (number) that will be used for communication between the client and server. The port value for the client and server must agree.

password

An initial password to pass to the server. If the server is not accepting passwords, then this argument is ignored. If the initial pasword is incorrect, then assuming the server's maxretry>1, then you will be interactively asked to enter the password.

file

A character string pointing to the file you wish to execute/source. Either this or script (but not both) should be provided.

script

A character string containing the commands you wish to execute/source. Either this or file (but not both) should be provided.

timer

Logical; should the "performance prompt", which shows timing statistics after every command, be used?

serialversion

NULL or numeric; the workspace format version to use when serializing. NULL specifies the current default version. The only other supported values are 2 and 3.

Details

Note that batch() can not be run from inside an active connection. Its purpose is to bypass the need to start a connection via client()

Value

Returns TRUE invisibly on successful exit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(remoter)
### NOTE first run a server via remoter::server() )in a separate R session.
### For simplicity, assume they are on the same machine.

# Run a script in an R file on the local/client machine
file <- "/path/to/an/R/script.r"
batch(file=file)

# Run a script stored in a character vector
script <- "1+1"
batch(script="1+1")

## End(Not run)

wrathematics/remoter documentation built on Oct. 27, 2019, 4:20 a.m.