1

I am working on a remote Linux server with R. I have made a plot in R using ggplot().

p <- ggplot(new_df) + geom_line(aes(x=dt, y=user_cnt))

However, when I want to view the plot as

>p

I get the following error: Error: is.integer(group) is not TRUE

Also when I want to save the plot to a file with the following code:

jpeg("myplot.jpg")
ggplot(new_df) + geom_line(aes(x=dt, y=user_cnt)
dev.off()

I still get the error: Error: is.integer(group) is not TRUE

This problem does not occur when I'm working with the RGui on Windows. How can I view/save my plot on the Linux server? I am connected from Windows 10 using PuTTy.

Asmita Poddar
  • 524
  • 1
  • 11
  • 27
  • A general comment, the preferred way to save a `ggplot` object is using `ggsave()`. :-) – drmariod Jun 21 '17 at 07:02
  • ggsave() also gives the same error. – Asmita Poddar Jun 21 '17 at 07:09
  • 2
    Have you seen [this](https://stackoverflow.com/questions/40762729/error-is-integergroup-is-not-true-while-using-ggmap-in-r)? Also, please post [enough information for us to debug this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Roman Luštrik Jun 21 '17 at 07:09
  • This error seems to be associated with posts on other forums that are several years old, suggesting that upgrading `ggplot2` and associated packages may help. – neilfws Jun 21 '17 at 22:04
  • Upgrading the packages does not help. – Asmita Poddar Jun 22 '17 at 09:32

2 Answers2

1

You can't view any pictures on TTY. So you need ftp tools.

To download Git, and install it. Then, open Git Bash, and use sftp user@ip to connect to your servicer. Finally use get filesName to get your files.

P.S. Excuse me for my poor English, please.

0

Just to visualize you can use plot().

I.e. plot(p)

However I am also having issues with saving the plot (will update this if I figure out a solution).

Kirk Geier
  • 499
  • 8
  • 15