Utility function that supports easy file matching and download from a remote FTP server. Also enables on-the-fly file renaming and compression.

transmit(remoteDir, localDir = ".", pattern, rename = NULL,
  compress = FALSE)

Arguments

remoteDir

character(1). Remote FTP directory path.

localDir

character(1). Directory where to save files locally.

pattern

character(1). Pattern to match against remote file names.

rename

character(1) or NULL. Rename the local files (including suffix), if desired.

compress

logical(1). gzip compress the files after download.

Value

Invisible character. Local file paths.

Examples

## This doesn't work reliably on Travis CI. ## remoteDir <- paste( ## "ftp://ftp.pantherdb.org", ## "sequence_classifications", ## "current_release", ## sep = "/" ## ) ## readme <- transmit( ## remoteDir = remoteDir, ## pattern = "README", ## rename = "panther_readme.txt", ## compress = TRUE ## ) ## basename(readme) ## file.exists(readme) ## Clean up. ## unlink(readme)