Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created July 10, 2013 13:34
Show Gist options
  • Save nassimhaddad/5966317 to your computer and use it in GitHub Desktop.
Save nassimhaddad/5966317 to your computer and use it in GitHub Desktop.
Example of how to get data from an ftp site using R
library(RCurl)
# code in the address
address <- 'ftp://user:[email protected]'
# get the list of files
items <- strsplit(getURL(address, .opts=curlOptions(ftplistonly=TRUE)), "\r\n")[[1]]
# download a file
download.file(paste0(address, "/",items[1]) , items[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment