installr v0.21.0


Monthly downloads



Using R to Install Stuff (Such As: R, 'Rtools', 'RStudio', 'Git', and More!)

R is great for installing software. Through the 'installr' package you can automate the updating of R (on Windows, using updateR()) and install new software. Software installation is initiated through a GUI (just run installr()), or through functions such as: install.Rtools(), install.pandoc(), install.git(), and many more. The updateR() command performs the following: finding the latest R version, downloading it, running the installer, deleting the installation file, copy and updating old packages to the new R installation.


Build Status CRAN_Status_Badge



The installr package offers a set of R functions for the installation and updating of software (currently, only on Windows OS), with a special focus on R itself. This package has two main goals:

  1. To make updating R (on windows) as easy as running a function.
  2. To make it as easy as possible to install all of the needed software for R development (such as git, RTools, etc), as well as for reproducible research using R (such as MikTeX, pandoc, etc).


While for Linux users, the installation process of new software may be just running a short line of code, for the regular Windows user it often includes browsing online, finding the latest version, downloading it, running the installer, and deleting the installation file. All of these steps are automatically done using functions in this package.


To install the stable version on CRAN:


To install the latest installr version from GitHub use:

if (!require('devtools')) install.packages('devtools'); # make sure you have Rtools installed first! if not, then run:


If you are using the Rgui, you will see a new menu added on your top right (just by "help"), giving you the option to update R, or install new software.

For command line use you can update R by running:

if(!require("installr")) install.packages('installr')
updateR() # this will open dialog boxes to take you through the steps.
# OR use:
# updateR(TRUE) # this will use common defaults and will be the safest/fastest option

Or install a new software simply by running:

installr() #  user can easily select (via a GUI interface) a software to install.


If you get either of the following errors from some commands:

Error in download.file(URL, destfile = ...) : 
  unsupported URL scheme


Error in file(con, "r") : cannot open the connection
Error in file(con, "r") : cannot open the connection

Try running:




You are welcome to:

Available functions are:

You can see the most recent changes to the package in the file:

  • R install/update/uninstall related functions:

    * updateR() - serves as a "check for updates" function of R itself.  Running the function will check for a newer version of R than the one currently used.  If one exists, the function will download the most updated R version and run its installer.  Once done, the function will offer to copy (or move) all of the packages from the old R library to the new R library. It will then offer to update the moved packages, offer to open the new Rgui, and lastely, it will quit the old R.
    * uninstall.R
    * require2 - just like "require", only makes sure to download and install the package in case it is not present on the system (useful for examples...)
    * restart_RGui - a function to restart Rgui from Rgui
    * check.for.updates.R
    * install.R
    * install.Rdevel - usefull for when developing R packages (as this version contains the latest checks.)
  • Installing software from withing R:

    * install.RStudio() - download and runs the installer for RStudio.
    * install.Rtools() - download and runs the installer for Rtools (allowing the user to choose which version to download)    
    * install.pandoc() - download and runs the installer for pandoc.
    * install.MikTeX() - download and runs the installer for MikTeX.
    * install.git() - download and runs the installer for git-gui.
    * - for installing package from a url of a ZIP file.  Currently, it is the only option I know of for downloading+installing a direct ZIP of an R package.
    * install.URL() - gets a URL of a zipped file, and makes sure to download and run it.
    * install.LyX()
    * install.LaTeX2RTF()
    * install.GitHub()
    * install.ImageMagick()
    * install.GraphicsMagick()
    * install.SWFTools()
    * install.FFmpeg()
    * install.7zip()
    * install.notepadpp()
    * install.npptor()
    * install.Cygwin()
  • Operation system managing functions

    * manage.os() - for shutdown/sleep of a Windows computer (useful for running at the end of a simulation).  Controls all the following functions.
    * os.hibernate()
    * os.lock()
    * os.restart()
    * os.shutdown()
    * os.sleep()
    * is.Rgui()
    * is.RStudio()
  • CRAN and network related functions:

    * cranometer - Estimates the speed of each CRAN mirror by measuring the time it takes to download the NEWS file.
    * myip - return your ip address.
    * freegeoip - Geolocate IP addresses in R (contributed by Heuristic Andrew)
    * download_RStudio_CRAN_data
    * read_RStudio_CRAN_data
    * barplot_package_users_per_day
    * lineplot_package_downloads
    * format_RStudio_CRAN_data
    * most_downloaded_packages
  • Misc functions:

    * is.empty - function added for checking if an object is empty (e.g: of zero length)
  • There are a few more functions that you could see in the help files...

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Functions in installr

Name Description
copy.packages.between.libraries Copies all packages from one library folder to another
check.for.updates.R Checks if there is a newer version of R
install.GitHub Downloads and installs GitHub for windows
install.git Downloads and installs git and git-gui for windows
install.inno Downloads and installs Inno Setup
fetch_tag_from_Rd Access tag elements from R's Rd file
install.python Downloads and installs python 2 or 3 Extract the file name from some URL
install.GraphicsMagick Downloads and installs GraphicsMagick for windows
installr-package Using R to Install Stuff (Such As: R, Rtools, RStudio, Git, and More!)
format_RStudio_CRAN_data Format the RStudio CRAN mirror data into the data.table format
check.integer Check if a number is integer
os.lock Locks the operating system (Windows) through a shell command
checkMD5sums2 Check and Create MD5 Checksum Files
get_pid Find the pid of a process by name
freegeoip Geolocate IP addresses in R Creates a global library folder
os.manage Gives managing option to the current OS (shutdown, restart, sleep, hibernate, etc...)
os.sleep Sleeps the operating system (Windows) through a shell command
package_authors Access (and clean) author elements from R's Rd file
updateR Checks for the latest R version, and if there is a newer version of R - downloads and installs it.
get_tasklist Get the running processes in windows task manager
download_RStudio_CRAN_data Download RStudio CRAN mirror data files into a folder
xlsx2csv Converts xls(x) to csv using VB
install.ImageMagick Downloads and installs ImageMagick for windows
cranometer Measures the speed of downloading from different CRAN mirrors
install.7zip Downloads and installs 7-Zip for windows
install.SWFTools Downloads and installs SWFTools for windows
install.Cygwin Downloads and installs Cygwin for windows
install.CMake Downloads and installs CMake for windows
install.LyX Downloads and installs LyX for windows
install.FFmpeg Downloads and installs FFmpeg for windows
install.LaTeX2RTF Downloads and installs LaTeX2RTF for windows
get.installed.R.folders Returns folder names with R installations Downloads and installs a ZIP R package Binary (for Windows) from a URL
install.MikTeX Downloads and installs MikTeX for windows
install.pandoc Downloads and installs pandoc
install.Rdevel Downloads and installs the latest Rdevel version
get_Rscript_PID Get the running "Rscript" processes PID
install.URL Downloads and runs a .exe installer file for some software from a URL
install.Texmaker Downloads and installs Texmaker for windows
install.Rtools Downloads and installs Rtools
install.conda Downloads and installs miniconda
installr Installing software from R
is.RStudio Checks if the R session is running within RStudio
is.x64 Checks if the running OS is x64 Remove a code line from .First
myip What is my IP
os.hibernate Hibernate the operating system (Windows) through a shell command
install.notepadpp Downloads and installs Notepad++ for windows
install.npptor Downloads and installs NppToR for windows
install.R Downloads and installs the latest R version
is.Rgui Checks if the R session is running within Rgui (Windows OS)
is.empty Checks if an object is empty (e.g: of zero length)
kill_all_Rscript_s kill (i.e.: stop) all running "Rscript" processes
kill_process kill (i.e.: stop) running processes by there process name
uninstall.packages uninstalls (removes) Installed Packages
lineplot_package_downloads barplot for the number of users installation of a package
kill_pid kill (i.e.: stop) running processes by there pid
remove.installr.GUI Removes the menu based GUI for updating R within Rgui
is.exe.installed Checks if some .exe is available in on the Windows machine search PATH Checks if the running OS is windows Remove a code line from .First
up_folder Performs "up-level" on a folder string
rename_r_to_R Rename files' extensions in a folder from .r to .R
turn.number.version Turns a vector of version-numbers back to version-character
read_RStudio_CRAN_data Reads RStudio CRAN mirror data files from a folder
require2 Loading Packages (and Installing them if they are missing)
pkgDNLs_worldmapcolor Worldmap colored by the number of downloads for a given package
source.https Read R Code from a File in an https URL
system.PATH Returns the search path for executable files Turns version to number (for a vector of values)
install.RStudio Downloads and installs RStudio for windows Install Java - downloads and set path openjdk Turns version to number (for 1 value only)
uninstall.R Uninstall an R version
install.nodejs Downloads and installs nodejs LTS or Current
load_installr_on_startup Have the installr package load on startup
most_downloaded_packages Most downloaded packages
os.restart Restarts the operating system (Windows) through a shell command
restart_RGui Restart RGui from RGui
rm_installr_from_startup Remove installr from startup
os.shutdown Shut down the operating system with the command `shutdown'
browse.latest.R.NEWS See the NEWS file for the latest R release
add_load_installr_on_startup_menu Add menu item for having installr load on startup
ask.user.yn.question Asks the user for one yes/no question.
add_remove_installr_from_startup_menu Add menu item for having installr NOT load on startup Add a code line to .First
add.installr.GUI Adds a menu based GUI for updating R within Rgui
R_version_in_a_folder Get the version of the R installed in a folder
barplot_package_users_per_day barplot for the number of users installation of a package
ask.user.for.a.row Asks the user for a row number from a data.frame table
No Results!

Last month downloads


Include our badge in your README