How to set R working dictionary to a remote server?

65 Views Asked by At

I'm using R studio and try to connect to an office server using SSH. It's connected but my R working dictionary is still local on my laptop. May I ask how I could set the working dictionary to the remote server? Any advice is welcome. Thank you!!

1

There are 1 best solutions below

0
On

You could write some script that uploads the files that are in git staging via scp. In PHP you could do something like this:

$rawFiles = shell_exec("git status --porcelain");
$files = explode("\n", $rawFiles);
foreach ($files as $file) {
    if ($file) {
        $filename = substr($file, 3);
        $command = "scp {$filename} [email protected]:/{$path}";
        shell_exec($command);
    }
}

and then execute this via CLI. It's a good idea to initialize all the variables above with parameters.