A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer's operating system in a consistent manner. A package manager deals with packages, distributions of software and data in archive files.Packages contain metadata, such as the software's name. Pac-Man 2.0 for Mac is free to download from our application library. The application is categorized as Games. The bundle identifier for this application is jp.co.bandainamcogames.NBGI0040m. This program is compatible with Mac OS X 10.6 or later. Nov 01, 2017  The new R version appear right after I install R and restart RStudio. Update: For Mac users, solution 3 is too painful and not working.

When was the last time you update your R and RStudio?

I installed RStudio and R a year ago, and never update it since then. Today I just noticed I cannot install new R packages because of my old R version. So I explore some ways to update R and would like to share with someone who is also looking to update R on RStudio.

Library Pacman R Mac

The problem

RStudio and R cannot update on their own because some packages may not work after switching to the new version (You can still downgrade R version in RStudio if something went wrong though). After you install the new version, the previously installed packages will not go to next version. So it is required extra procedures to move the packages.

Here are 3 ways you can update R version in RStudio. Note that we need to move the install R packages, which I will show how at the end.

3 Solutions to update R on RStudio

Solution 1) Manually install (Recommended if you don't care about the old packages)

The first method is to download a new version of R from R website > CRAN. Then restart your RStudio. The new R version will be loaded automatically.

The new R version appear right after I install R and restart RStudio

Update 29/05/2019: For Mac users, solution 3 is too painful and not working well for me. This method is fast and working well. I would recommend to save your time from headache and use this method. Take note of your previous packages so you can install them again as needed.

Solution 2) Windows only – use installr

installr is the R package which helps install and update software.

The R code you will need for updating R is: (credit goes to Cara Wogsland for the code)

install.packages('installr')

library(installr)

updateR()

You can find the tutorial on how to use installr to update RStudio on R-Statistics website.

Solution 3) Mac only – use updateR

Mac

Similar to installr, updateR is the package to help updating R on Mac OS.

The R code you will need is these 5 lines: (credit goes to jroberayalas for the code)

install.packages('devtools') #assuming it is not already installed

library(devtools)

install_github('andreacirilloac/updateR')

library(updateR)

updateR(admin_password = 'Admin user password')

You can find in-depth tutorial on how to use updateR package on this blog.

How to move the previously installed R packages

This is the instructions for Mac OS user (who used solution 1 or 3 above). For Windows user, installr package will do this for you

Library Pacman R Mac Download

(credit goes to RyanStochastic and micstr):

1. Move all folders from your old R version to new R version.

/Library/Frameworks/R.framework/Versions/x.xx/Resources/library

Replace x.xx with the old and new R version at a time.

Note that you have to move only the packages that are not currently in the destination folder (because those are the base packages, and you don’t want to ruin them). But if you already did replaced everything, the next step will solve this for you.

If you cannot find the proper path, you can run this command to check: installed.packages()

2. Update the moved packages

Run the following command in R. Type ‘y’ for every question that popped up.

update.packages(checkBuilt=TRUE)

3. Type the following command in R to check if everything went well

version

packageStatus()

That’s it! Hope you guys success in updating R. If not, please check in the reference link below.

References: https://stackoverflow.com/questions/13656699/update-r-using-rstudio

About Pacman

Pacman is the default package manager for the Arch Linux distribution of Linux.For more information and tips about using Pacman, visit theArch wiki.

About Pacman on OS X

This could be a much easier process if you use Homebrew to install the builddependencies for Pacman. I don't recommend keeping both for long, though.Having two package managers in use at once is a headache in wait, and it won'twait long.

Here I take the long way by compiling each dependency from source. I keep thedependencies installed to a directory called 'pacman-deps' in my home directory.This way, nothing I install will interfere with the OS X default installations.

Library Pacman R Machine

I've elected to install Pacman to to /usr/local. This is also thedirectory I'll be using for packages installed by Pacman.

An automated install script is available here:install.sh

PKGBUILDs for Pacman on OS X are located inthis repo.

1. gettext

OS X comes with gettext by default but this installation doesn't include autopoint.

2. autoconf

Again, included in OS X but without something we need, aclocal.

3. automake

Same story as the other two dependencies so far.

4. pkg-config
5. libtool
6. bash >= 4.1.0

Yosemite still ships with a 3.x version of bash which is not compatible with Pacman.We'll need to compile a newer version.

7. libarchive >= 2.8.0

Yosemite comes with libarchive 2.8.3 but doesn't include the header files we need,so we'll have to download the source code for the version of libarchive alreadyinstalled to get them.

8. asciidoc
9. fakeroot

Every available version of fakeroot for OS X seems not to compile on Yosemite,or at least not for me. Darwin fakeroot,however, required the least patching.So these instructions as well as any packages I create will assume thisimplementation of fakeroot.

This is not actually necessary to compile Pacman. But, it is necessaryto build packages once Pacman has been installed. So, it's recommended that youinstall this either before or after compiling Pacman for the first time, thenagain with the darwin-fakeroot package in thepacman-osx-pkgs repo.

Downloading the Pacman source

Finally, compiling Pacman

Fallacies & Pitfalls

Library Pacman R Machines

  • Once you've started using pacman to install packages, some of the softwarewe built just now will need to be overridden by using the --force optionwith pacman.