How to save files from Rstudio AMI EC2 on my local computer - r

I have installed Rstudio server Amazon EC2. It works fine, but I can't understand how to save files on my local computer...
In example,
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
EDIT:
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...
Any suggestions?
Best regards!

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.
You've started your EC2 instance of RStudio, thanks to helpful instructions elsewhere...
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...
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...
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:
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.

Related

cant get rscript to open in rstudio instead of web

I am supposed to access an rscript in my student account and save it but whenever I click on it instead of automatically opening rstudio it opens up in web browser as just texts.I cant figure how to get it to open in rstudio. can anyone help and explain why it won't open? I have to be save it as an rfile on my files but I cant since I cant get it there in the first place.
I would suggest save the file in your computer. Then open RStudio -> File -> Open File

Remove all prompts and save to a specified folder in AcrobatDC?

I am working with Adobe AcrobatDC and I need to OCR several images (PNG, EMF, JPEG) that are in a folder. I figured out how to create a batch process using the "Action Wizard" and it traverses the folder and creates text recognized PDF files. The only features I have not been able to figure out are how to automatically save the images into a specified folder. Currently my customized action will prompt me during he automation and ask if I "would like to save the file" and then prompt me again to "select a destination folder".
Question: Using Adobe AcrobatDC action wizard how do I create a batch process in order to automatically save to a specified folder and
eliminate all prompts ?
Add a "Save" step. In the options there, click the icon to the right of "Save". You can specify a local folder.

Publishing to shinyapps.io from RStudio reading all files in directory, not just checkboxed ones

I've uploaded apps to shinyapps.io in the past with little issue from RStudio. I have my shinyApp.R file (contains both server and ui) as well as the two CSV files that are used for it in the same directory.
When I click "Publish" I get the popup window as shown here:
Link to pic of check box.
I only select the .R file and the two data files to upload but when I click "Publish" I get errors about relative file references in two files that I'm not even trying to upload and have nothing to do with the app (see here Image of error screen.
It seems like rsconnect/deployApp is reading through every file in the parent and children directories regardless of whether or not I clicked the checkbox next to it. Anyone else have this issue?

Upload any file to ipython notebook directory

I have the following line on the notebook home page:
To import a notebook, drag the file onto the listing below or click here.
When I upload a text or any other file, I get an error message:
Invalid file type
Uploaded notebooks must be .ipynb files
How do I make it possible to upload any file ?
Is there any setting/ add on that will allow this?
This is now implemented on master (futur 3.0), we now have the content webservice which can deal with non-ipynb file. Just drag file onto the dashboard and it works(tm).
Keep in mind that this upload on the machine were the webserver is, not the machines were the kernels run in case they are not the same.

How to make RStudio File Navigator open Current Working Directory by default?

This is a very small issue but every time I do it, I wonder if there is such a convenience.
In RStudio, file navigator always opens in home directory by default. Is there a way to make it open the current working directory automatically or by using a shortcut?
To open current working directory you can simply use the "Set As Working Directory" button in Files -> More menu.

Resources