Using svSocket and data.table together in R. No audio. Press HD full screen.
Why Stack Overflow recommends it
Stack Overflow users link it as the demo for svSocket when answering how to exchange data between R processes, run background tasks, or control a remote R session.
Recommended by 3 people across 3 different months, 2011 to 2022.
What it is
A silent 7m46s screen recording by data.table author Matt Dowle showing how to use the R svSocket package together with data.table. It turns an R session into a socket server, sends it commands, and pulls results back, even while the server is busy with a long job.
What people said
Recommends Matt Dowle · 2011-09 · Stack Overflow · on “Can the R console support background tasks or interrupts (event-handling)?”
One more option is the svSocket package [LINK] . It is non blocking. Here is an 8 minute video [this video] using it, which has over 3,000 views. It shows how to turn an R session into a server and how to send commands to it and receive data back. It demonstrates doing that even while the server is busy; e.g., say you start a long running process and forget to save intermediate results, you can connect to the server and fetch the results (before it has finished) from it.
Recommends flodel · 2014-08 · Stack Overflow · on “Is it possible to push/pull variables between two instances of R?”
Have a look at svSocket . From the package description at: svSocket.pdf [LINK] The SciViews svSocket package provides a stateful, multi-client and preemtive socket server. [...] Although initially designed to server GUI clients, the R socket server can also be used to exchange data between separate R processes. This demo video [this video] is really worth it.
Recommends russellpierce · 2017-11 · Stack Overflow · on “Using RStudio with R backend on cluster via SSH”
In line with the hackish options @hrbrmstr mentioned... If your aim is to run mostly non-interactive code, then you can probably establish an n-node parallel::makePSOCKcluster() on the remote machines and run each of your commands via parallel like commands. Similarly, you could use package::svSocket, see this neat demo on YouTube for more details than fit in a reasonable answer [this video] . But, given that you said RStudio, I suspect you are thinking of interactive use, and the above would be doable (but painful). Nothing I know of will let you just pretend that the remote machine is the local machine (which is a pity to be sure). However you might be able to hack something together, with sink
Cites r2evans · 2022-11 · Stack Overflow · on “How to change a variable in a loop by a user input in R”
The link's first answer uses `readline`, which does not allow asking a question while operating an "infinite loop". The second link answer uses the `tcltk2` package, which is not "console" (it's widgets), and that package has not been updated in 8 years. While I confess that the [this video] (link from the package docs, that's all) of `svSocket` being demonstrated is cool, I'm not sure it's the right tool for what Camilo is attempting to do. @Chris, did you find something that supports _non-blocking_ reading of user input?