Learn R Programming

⚠️There's a newer version (0.23.4) of this package.Take me there.

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.

Copy Link

Version

Install

install.packages('installr')

Monthly Downloads

36,320

Version

0.23.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Tal Galili

Last Published

May 8th, 2021

Functions in installr (0.23.2)

barplot_package_users_per_day

barplot for the number of users installation of a package
add_load_installr_on_startup_menu

Add menu item for having installr load on startup
check.for.updates.R

Checks if there is a newer version of R
add.installr.GUI

Adds a menu based GUI for updating R within Rgui
ask.user.yn.question

Asks the user for one yes/no question.
R_version_in_a_folder

Get the version of the R installed in a folder
browse.latest.R.NEWS

See the NEWS file for the latest R release
add_remove_installr_from_startup_menu

Add menu item for having installr NOT load on startup
add_to_.First_in_Rprofile.site

Add a code line to Rprofile.site .First
ask.user.for.a.row

Asks the user for a row number from a data.frame table
copy.packages.between.libraries

Copies all packages from one library folder to another
check.integer

Check if a number is integer
checkMD5sums2

Check and Create MD5 Checksum Files
create.global.library

Creates a global library folder
download_RStudio_CRAN_data

Download RStudio CRAN mirror data files into a folder
get_latest_r_version

Fetches latest R version from CRAN
get_pid

Find the pid of a process by name
fetch_tag_from_Rd

Access tag elements from R's Rd file
install.GraphicsMagick

Downloads and installs GraphicsMagick for windows
install.CMake

Downloads and installs CMake for windows
install.ImageMagick

Downloads and installs ImageMagick for windows
install.Cygwin

Downloads and installs Cygwin for windows
file.name.from.url

Extract the file name from some URL
get_Rscript_PID

Get the running "Rscript" processes PID
get.installed.R.folders

Returns folder names with R installations
format_RStudio_CRAN_data

Format the RStudio CRAN mirror data into the data.table format
cranometer

Measures the speed of downloading from different CRAN mirrors
install.LaTeX2RTF

Downloads and installs LaTeX2RTF for windows
install.GitHub

Downloads and installs GitHub for windows
install.Rdevel

Downloads and installs the latest Rdevel version
install.RStudio

Downloads and installs RStudio for windows
install.LyX

Downloads and installs LyX for windows
install.FFmpeg

Downloads and installs FFmpeg for windows
install.7zip

Downloads and installs 7-Zip for windows
freegeoip

Geolocate IP addresses in R
get_tasklist

Get the running processes in windows task manager
install.notepadpp

Downloads and installs Notepad++ for windows
install.nodejs

Downloads and installs nodejs LTS or Current
install.Rtools

Downloads and installs Rtools
install.MikTeX

Downloads and installs MikTeX for windows
is.empty

Checks if an object is empty (e.g: of zero length)
install.git

Downloads and installs git and git-gui for windows
install.conda

Downloads and installs miniconda
install.pandoc

Downloads and installs pandoc
install.python

Downloads and installs python 2 or 3
most_downloaded_packages

Most downloaded packages
is_in_.First_in_Rprofile.site

Remove a code line from Rprofile.site .First
package_authors

Access (and clean) author elements from R's Rd file
is.exe.installed

Checks if some .exe is available in on the Windows machine search PATH
kill_all_Rscript_s

kill (i.e.: stop) all running "Rscript" processes
install.R

Downloads and installs the latest R version
is.windows

Checks if the running OS is windows
is.x64

Checks if the running OS is x64
pkgDNLs_worldmapcolor

Worldmap colored by the number of downloads for a given package
myip

What is my IP
install.npptor

Downloads and installs NppToR for windows
os.lock

Locks the operating system (Windows) through a shell command
os.hibernate

Hibernate the operating system (Windows) through a shell command
install.inno

Downloads and installs Inno Setup
install.java

Install Java - downloads and set path openjdk
os.sleep

Sleeps the operating system (Windows) through a shell command
os.shutdown

Shut down the operating system with the command `shutdown'
system.PATH

Returns the search path for executable files
uninstall.R

Uninstall an R version
remove.installr.GUI

Removes the menu based GUI for updating R within Rgui
read_RStudio_CRAN_data

Reads RStudio CRAN mirror data files from a folder
uninstall.packages

uninstalls (removes) Installed Packages
install.SWFTools

Downloads and installs SWFTools for windows
is.Rgui

Checks if the R session is running within Rgui (Windows OS)
is.RStudio

Checks if the R session is running within RStudio
xlsx2csv

Converts xls(x) to csv using VB
turn.number.version

Turns a vector of version-numbers back to version-character
install.URL

Downloads and runs a .exe installer file for some software from a URL
kill_process

kill (i.e.: stop) running processes by there process name
kill_pid

kill (i.e.: stop) running processes by there pid
install.Texmaker

Downloads and installs Texmaker for windows
require2

Loading Packages (and Installing them if they are missing)
lineplot_package_downloads

barplot for the number of users installation of a package
os.manage

Gives managing option to the current OS (shutdown, restart, sleep, hibernate, etc...)
load_installr_on_startup

Have the installr package load on startup
install.packages.zip

Downloads and installs a ZIP R package Binary (for Windows) from a URL
os.restart

Restarts the operating system (Windows) through a shell command
installr-package

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

Performs "up-level" on a folder string
rm_installr_from_startup

Remove installr from startup
source.https

Read R Code from a File in an https URL
turn.version.to.number

Turns version to number (for a vector of values)
remove_from_.First_in_Rprofile.site

Remove a code line from Rprofile.site .First
restart_RGui

Restart RGui from RGui
installr

Installing software from R
rename_r_to_R

Rename files' extensions in a folder from .r to .R
turn.version.to.number1

Turns version to number (for 1 value only)
updateR

Checks for the latest R version, and if there is a newer version of R - downloads and installs it.