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.

Note

Updated 2019-08-15.

Examples

## This doesn't work reliably on 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) ## > unlink(readme)