Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Graphics with remoter #29

Open
iagomez opened this issue Oct 4, 2016 · 8 comments
Open

[Question] Graphics with remoter #29

iagomez opened this issue Oct 4, 2016 · 8 comments

Comments

@iagomez
Copy link

iagomez commented Oct 4, 2016

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
Copy link
Member

snoweye commented Oct 4, 2016

@snoweye snoweye closed this as completed Oct 4, 2016
@snoweye snoweye reopened this Oct 5, 2016
@iagomez
Copy link
Author

iagomez commented Oct 5, 2016

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
Copy link
Member

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
Copy link
Author

iagomez commented Oct 5, 2016

Thank you @wrathematics

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

@snoweye
Copy link
Member

snoweye commented Oct 6, 2016

  • This version may still work well without s2c and evalc, but no guarantee.
  • The question is why you want to s2c that object g1 rather than the data creating g1 back to local?

@iagomez
Copy link
Author

iagomez commented Oct 6, 2016

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
Copy link

slowkow commented Feb 14, 2018

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
Copy link
Member

snoweye commented Feb 15, 2018

  • Short answer long: resize the plotting window because it is plotted as a bitmap not regular plot/graph displayed at client window or save the plot in a pdf file and use s2c to bring the file back.
  • Median answer median: adjust the windows size before plotting the image and disallow resizing after that.
  • Long answer short: a callback function is not easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants