# Upload an Entire Directory through SFTP with R

I wanted to speed up the process of uploading this website to the hosting server, as opposed to doing a lot of drag and drop to the ftp client. It turned out to be super easy using R. If you need to do the same, the following code can help get you there. It will replace old files and directories and create new ones as needed.

Simply set your working directory to the root directory that holds the folders/files you want to upload. Then do the following:

• Replace User with your username
• Replace Password with your password
• Replace FTPServer with the server name
• Replace your_directory_name with the root directory on the server you want to update
Run the code below and you are golden.
library(RCurl)

}