RBigData / remoter

Control a remote R session from your local R session.
Other
83 stars 11 forks source link

[Question] Graphics with remoter #29

Open iagomez opened 7 years ago

iagomez commented 7 years ago

Remoter is great for running code in a remote server. How can I create graphs and have them display in my local R Studio window?

i.e

counts <- table(mtcars$gear)
barplot(counts, main="Car Distribution", xlab="Number of Gears")
snoweye commented 7 years ago

https://github.com/snoweye/user2016.demo may help.

iagomez commented 7 years ago

Thank you for the link @snoweye

Do you know if R needs some specific capabilities enabled for the graph to show up without using the s2c function?

The following still doesn't show the graphs on my R Studio window:

g1 <- ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point(aes(shape = Species))
g1

But executing the following 2 lines does display the graph in the plots panel:

s2c(g1)
evalc(g1)

Again, thank you for your help!

wrathematics commented 7 years ago

We had a bunch of changes over the summer, and it's quite likely that I messed something up during a merge. I'll take a look as soon as I can.

iagomez commented 7 years ago

Thank you @wrathematics

I'm using the remoter package from CRAN. Should I be using the github version instead?

snoweye commented 7 years ago
iagomez commented 7 years ago

Thank you. I can try with that version.

Well, I was just trying different things to see if the image would show up. Ideally, I would like to write code that still runs if I'm not connected to a remoter::server Ideally without any s2c or evalc

slowkow commented 6 years ago

I get a plot in my RStudio session, but it is distorted.

Could I ask if it's possible to fix the distortion?

Here's what it looks like on my screen:

(Notice that the text is stretched horizontally)

library(ggplot2)
qplot(1:4, 1:4)

image

snoweye commented 6 years ago