batch: Batch Execution

Description Usage Arguments Details Value Examples

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)

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 procided.

script

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

timer

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

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)

remoter documentation built on May 2, 2019, 6:12 a.m.