Gets a character with a link to an installer file, downloads it, runs it, and then erases it.
install.URL(exe_URL, keep_install_file = FALSE, wait = TRUE,
download_dir = tempdir(), message = TRUE, installer_option = NULL,
download_fun = download.file, ...)
A character with a link to an installer file (with the .exe file extension)
If TRUE - the installer file will not be erased after it is downloaded and run.
should the R interpreter wait for the command to finish? The default is to NOT wait.
A character of the directory into which to download the file. (default is tempdir())
boolean. Should a message on the file be printed or not (default is TRUE)
A character of the command line arguments
a function to use for downloading. Default is download.file. We can also use curl_download (but it doesn't give as good of an output while downloading the file).
parameters passed to 'shell'
invisible(TRUE/FALSE) - was the installation successful or not. (this is based on the output of shell of running the command being either 0 or 1/2. 0 means the file was successfully installed, while 1 or 2 means there was a failure in running the installer.)
This function is used by many functions in the installr package. The .exe file is downloaded into a temporary directory, where it is erased after installation has started (by default - though this can be changed)
# NOT RUN {
install.URL("adfadf") # shows the error produced when the URL is not valid.
# }
Run the code above in your browser using DataLab