Using R to Install Stuff on Windows OS (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 AppVeyor build status

installr

Introduction

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).

Motivation

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.

Installation

To install the stable version on CRAN:

install.packages('installr')

To install the latest installr version from GitHub use:

if (!require('remotes')) install.packages('remotes'); # make sure you have Rtools installed first! if not, then run:
#install.packages('installr')
#install.Rtools()
remotes::install_github('talgalili/installr')

Usage

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')
library("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:

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

Troubleshooting

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

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

Or:

install.RStudio()
Error in file(con, "r") : cannot open the connection
updateR()
Error in file(con, "r") : cannot open the connection

Try running:

setInternet2(TRUE)

Sources:

Contact

You are welcome to:

Available functions are:

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

http://talgalili.github.io/installr/news/index.html

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.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("installr")

0.23.4 by Tal Galili, 4 years ago


https://talgalili.github.io/installr/, https://github.com/talgalili/installr/, https://www.r-statistics.com/tag/installr/


Report a bug at https://github.com/talgalili/installr/issues


Browse source code at https://github.com/cran/installr


Authors: Tal Galili [aut, cre, cph] (http://www.r-statistics.com) , Barry Rowlingson [ctb] , Boris Hejblum [ctb] , Dason [ctb] , Felix Schonbrodt [ctb] , G. Grothendieck [ctb] , GERGELY DAROCZI [ctb] , Heuristic Andrew [ctb] , James [ctb] (http://stackoverflow.com/users/269476/james) , Thomas Leeper [ctb] (http://thomasleeper.com/) , VitoshKa [ctb] , Yihui Xie [ctb] (http://yihui.name) , Michael Friendly [ctb] (http://datavis.ca/) , Kornelius Rohmeyer [ctb] (http://algorithm-forge.com/techblog/) , Dieter Menne [ctb] , Tyler Hunt [ctb] (https://github.com/JackStat) , Takekatsu Hiramura [ctb] (https://github.com/hiratake55) , Berry Boessenkool [ctb] (https://github.com/BerryBoessenkool) , Jonathan Godfrey [ctb] (https://github.com/ajrgodfrey) , Tom Allard [ctb] , ChingChuan Chen [ctb] , Jonathan Hill [ctb] , Chan-Yub Park [ctb] (https://github.com/mrchypark) , Gerhard Nachtmann [ctb] , Russ Hyde [ctb] , Lyndon D'Arcy [ctb] (https://github.com/logworthy) , Gerhard Burger [ctb] (https://github.com/burgerga) , Adrian Hordyk [ctb] (https://github.com/AdrianHordyk) , Arthur Gailes [ctb] (https://github.com/arthurgailes)


Documentation:   PDF Manual  


GPL-2 license


Imports stringr, utils

Suggests curl, XML, devtools, rjson, data.table, plyr, ggplot2, sp, tools, pkgbuild, testthat, mockery, R.utils


Suggested by bsitar.


See at CRAN