Search notes:

R function: download.file

download.file can be used to download a file from the internet.
fileUrl <- 'https://raw.githubusercontent.com/ReneNyffenegger/about-r/master/functions/download.file.R';

dest <- paste0(Sys.getenv('TEMP'), '/download.file.R');
download.file(fileUrl, destfile = dest);

fileContent <- readLines(dest);

writeLines(fileContent);
Github repository about-r, path: /functions/download.file.R

Binary files on Windows

In order to download binary files on Windows, the parameter mode should be set to "wb".

See also

Index to (some) R functions

Index