Get/set your working directory in R using getwd() and setwd().
Check for and create directories using file.exists("directoryName") and dir.create("directoryName")
Getting data from the internet using download.file(url="", destfile="", method="curl")
- If the URL starts with http, you can use download.file()
- If the URL starts with https, you may need to set method="curl" on a Mac - Windows is ok with the default method
- Be sure to record when you downloaded the file.