remoter (version 0.4-0)

batch: Batch Execution

Description

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

Usage

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?

Value

Returns TRUE invisibly on successful exit.

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()

Examples

Run this code
# 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")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab