Asmita Poddar
Asmita Poddar

Reputation: 532

View/ save R plot on the Linux server

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.

Upvotes: 1

Views: 1663

Answers (2)

Kirk Geier
Kirk Geier

Reputation: 524

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).

Upvotes: 0

Togtokh Khorchin
Togtokh Khorchin

Reputation: 331

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.

Upvotes: 1

Related Questions