Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using R to save images & .csv's, can I use R to upload them to website (use filezilla to do it manually)?

First I should say that a lot of this is over my head, so I apologize in advance for using incorrect terminology and potentially asking an unclear question. I'm doing my best.

Also, I saw ThisPost; is RCurl the tool I want to use for this task?

Every day for 4 months I'll be analyzing new data, and generating .csv files and .png's that need to be uploaded to a web site so that other team members will be checking. I've (nearly) automated all of the data collecting, data downloading, analysis, and file saving. The analysis is carried out in R, and R saves the files. Currently I use Filezilla to manually upload the new files to the website. Is there a way to use R to upload the files to the web site, so that I don't have to open Filezilla and drag+drop files?

It'd be nice to run my R-code and walk away, knowing that once it finishes running, the newly saved files will be automatically be put on the website.

Thanks for any help!

like image 254
rbatt Avatar asked Oct 04 '22 05:10

rbatt


1 Answers

You didn't specify which protocol you use to upload your files using FileZilla. I assume it is ftp. If so, you can use the ftpUpload function of RCurl:

library(RCurl)
ftpUpload("yourfile", "ftp://ftp.yourserver.foo/yourfile", 
    userpwd="username:passwd")

RCurl also had methods for scp and should also support sftp using ftpUpload.

like image 104
Jan van der Laan Avatar answered Oct 19 '22 16:10

Jan van der Laan