rView: Simplify viewing of R objects on remote machine via RStudio,...

Description Usage Arguments Details

View source: R/rView.R

Description

This function is designed to be used on both the remote RStudio session and also on the local RStudio session. It does different things in each session.

Usage

1
rView(obj, port = NULL)

Arguments

obj

The R object to view.

port

The number of the port to access on the local machine to download objects. Note that you can give the command rView(port = XXXX) without any reference to obj, because obj is not used within the function before exiting it when simply updating the port.

Details

On the remote session, which is identified by having getOption("rmote_server_dir") being nonNULL, rView(x) saves the object x to an rds file called x.rds in a directory called rview_objs in the rmote_server_dir. If it is called by piping an output into rView(), then the object gets written to __dot.rds.

On the local session, calling rView(x) downloads x.rds from the forwarded port that is hosting files from the remote machine at rmote_server_dir, then it sends it to the View() command, to view in an RStudio data browser window, that it names "r:x". Piping output into rView or calling rView(.) downloads the object in __dot.rds and views it in an RStudio data browser window (named "r:.").

In the local session, if getOption("rview_port") is not defined (as it likely will not be in a new session) then you can set it to what it should be using the port argument. For example, if the remote machine is forwarding rmote traffic to port 4321, you would use rView(port = 4321).

See the vignette for information about setting up port forwarding, and how to use this function in a high-performance computer cluster environment.


eriqande/rView documentation built on March 25, 2020, 12:06 a.m.