如何在我的本地计算机上保存来自 Rstudio AMI EC2 的文件 [英] How to save files from Rstudio AMI EC2 on my local computer

查看:26
本文介绍了如何在我的本地计算机上保存来自 Rstudio AMI EC2 的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Rstudio 服务器 Amazon EC2.它工作正常,但我无法理解如何在本地计算机上保存文件...

I have installed Rstudio server Amazon EC2. It works fine, but I can't understand how to save files on my local computer...

例如,

x=5
write.csv(x,file="x.csv")
getwd()
[1] "/home/rstudio"

I can see the file in my working directory, but I cannot change w.d...

setwd("C:\Users\Paul\Documents\R")
Error in setwd("C:\Users\Paul\Documents\R") : 
  cannot change working directory

我收到网络错误:连接超时...如果我使用来自codingthis.com/platforms/ec2/的说明...使用Putty...或者主机不存在"如果我使用winSCP...

I get Network error: Connection timeout... if i use instructions from codingthis.com/platforms/ec2/… using Putty... Or "Host does not exist" if I use winSCP...

有什么建议吗?

最好的问候!

推荐答案

如果你不能让 SCP 工作,这里有一个更简单的方法.首先,我将展示如何保存绘图,然后是如何保存您用 R 制作的 CSV 文件.

If you can't make SCP work, here's a simpler way. First I'll show how to save a plot, then how to save a CSV file that you've made with R.

感谢其他地方的有用说明,您已经启动了 RStudio 的 EC2 实例...

You've started your EC2 instance of RStudio, thanks to helpful instructions elsewhere...

现在您已经制作了一个情节并且您想保存该情节...查看导出"按钮的绘图窗口并单击该按钮,然后单击将绘图另存为图像"(或 PDF,如果您愿意)

Now you've made a plot and you want to save that plot... Look at the plot window for the "Export" button and click that, then click 'save plot as image' (or PDF if you prefer)

按照提示保存在默认位置...

Follow the prompt and save it in the default location...

现在通过单击 RStudio 中的文件"选项卡从绘图窗口切换到文件窗口...您应该在那里的列表中看到您的绘图图像文件.现在点击更多",然后点击导出..."

Now switch from the plot window to the files window by clicking on the 'Files' tab in RStudio... You should see your plot image file in the list there. Now click 'More' then "Export..."

此时可以编辑文件名...

You can edit the file name at this point...

然后在您点击下载后,它将下载到您的默认下载目录...

And then after you click download it will download to your default download directory...

如果您使用 R 制作了输出的 csv 文件,您可以以同样的方式将其导出到您的下载目录,您可以在此处看到我的文件d.csv",并在其旁边的复选框中文件"窗口.我点击了更多..."按钮,然后点击导出..."

If you've used R to make a csv file of output, you can export that to your download directory in the same way, you can see my file 'd.csv', here with the checked box next to it in the 'Files' window. I've clicked on the 'More...' button, then 'Export...'

现在我可以编辑名称,点击下载",然后将转到我的默认下载目录:

Now I can edit the name, click 'Download' and will go to my default download directory:

这能回答你的问题吗?如果您的下一个问题是如何将文件导入 EC2 上的 RStudio?",请先尝试使用 Rstudio 的文件"窗口中的上传"按钮.

Does that answer your question? If your next question will be "how do I get files into RStudio on EC2?", please first experiment with the "Upload" button in the 'Files' window of Rstudio.

这篇关于如何在我的本地计算机上保存来自 Rstudio AMI EC2 的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆