4  Installing R under macOS – R Manuals :: R Installation and Administration (2024)

[The rest of this paragraph is only relevant after release.] The front page of a CRAN site has a link ‘Download R for (Mac) OS X’ which takes you to a new page. Two files are offered for download, R-4.5.0 Under development-arm64.pkg and R-4.5.0 Under development-x86_64.pkg. Both are for macOS 11 or later (Big Sur, Monterey, Ventura, Sonoma, …).

The first is for ‘Apple Silicon’ (aka ‘M1’, ‘M2’, …) Macs, the second for older Macs with an x86_64 (Intel) CPU.

It is important that if you use a binary installer package that your OS is fully updated: look at ‘Software Update’ in ‘System Preferences’ to be sure.

To install, just double-click on the icon of the file you downloaded. At the ‘Installation Type’ stage, note the option to ‘Customize’. This currently shows four components: everyone will need the ‘R Framework’ component: the remaining components are optional. (The ‘Tcl/Tk’ component is needed to use package tcltk. The ‘Texinfo’ component is only needed by those installing source packages or R from its sources.)

Note for Ventura users: installation from the Downloads folder may not be allowed or may require additional authorization, so we suggest you download somewhere else such as your desktop or home folder.

These are Apple Installer packages. If you encounter any problem during the installation, please check the Installer log by clicking on the “Window” menu and item “Installer Log”. The full output (select “Show All Log”) is useful for tracking down problems. Note that the installer is clever enough to try to upgrade the last-installed version of the application where you installed it (which may not be where you want this time …).

Various parts of the build require XQuartz to be installed: see https://www.xquartz.org/releases/.1 These include the tcltk package and the X11 graphics device: attempting to use these without XQuartz will remind you. This is also needed for some builds of the cairographics-based devices (which are not often used on macOS) such as png(type = "cairo") and svg() and some third-party packages (e.g.rgl).

1At the time of writing, version 2.8.5 or later.

If you update your macOS version, you should re-install R (and perhaps XQuartz): the installer may tailor the installation to the current version of the OS.

Installers for R-patched and R-devel are usually available from https://mac.R-project.org. (Some of these packages may be unsigned/not notarized: to install those Control/right/two-finger click, select Open With and Installer.)

For building R from source, see macOS.

4.1 Running R under macOS

There are two ways to run R on macOS from a CRAN binary distribution.

There is a GUI console normally installed with the R icon in /Applications which you can run by double-clicking (e.g.from Launchpad or Finder). (If you cannot find it there it was possibly installed elsewhere so try searching for it in Spotlight.) This is usually referred to as R.APP to distinguish it from command-line R: its user manual is currently part of the macOS FAQ at https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html and can be viewed from R.APP‘s ’Help’ menu.

You can run command-line R and Rscript from a Terminal2 so these can be typed as commands as on any other Unix-alike: see the next chapter of this manual. There are some small differences which may surprise users of R on other platforms, notably the default location of the personal library directory (under ~/Library/R, e.g.~/Library/R/arm64/4.4/library), and that warnings, messages and other output to stderr are highlighted in bold.

2The installer puts links to R and Rscript in /usr/local/bin. If these are missing or that is not on your path, you can run directly the copies in /Library/Frameworks/R.framework/Resources/bin or link those yourself to somewhere on your path.

Those using the zsh shell (the default for new user accounts) might find the command R being masked by the zsh builtin r (which recalls commands). One can use a full path to R in an alias, or add disable r to ~/.zshrc.

It has been reported that running R.APP may fail if no preferences are stored, so if it fails when launched for the very first time, try it again (the first attempt will store some preferences).

Users of R.APP need to be aware of the ‘App Nap’ feature (https://developer.apple.com/library/archive/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_9.html) which can cause R tasks to appear to run very slowly when not producing output in the console. Here are ways to avoid it:

Using the X11 graphics device or the X11-based versions of View() and edit() for data frames and matrices (the latter are the default for command-line R but not R.APP) requires XQuartz to be installed.

Under some rather nebulous circ*mstances messages have been seen from fontconfig about missing/unreadable configuration files when using cairo-based devices, especially X11(type = "cairo"). With XQuartz installed there are two fontconfig areas from different versions and it can help to set

setenv FONTCONFIG_PATH /opt/X11/lib/X11/fontconfig

Another symptom has been that italic/oblique fonts are replaced by upright ones.

4.2 Uninstalling under macOS

R for macOS consists of two parts: the GUI (R.APP) and the R framework. Un-installation is as simple as removing those folders (e.g. by dragging them onto the Bin3). The typical installation will install the GUI into the /Applications/R.app folder and the R framework into the /Library/Frameworks/R.framework folder. The links to R and Rscript in /usr/local/bin should also be removed.

3Formerly known as the Trash.

If you want to get rid of R more completely using a Terminal, simply run:

sudo rm -Rf /Library/Frameworks/R.framework /Applications/R.app \ /usr/local/bin/R /usr/local/bin/Rscript

The installation consists of up to four Apple packages:4 for the ‘Apple Silicon’ build, org.R-project.arm64.R.fw.pkg, org.R-project.arm64.R.GUI.pkg, org.r-project.arm64.tcltk and org.r-project.arm64.texinfo. You can use sudo pkgutil --forget if you want the Apple Installer to forget about the package without deleting its files (useful for the R framework when installing multiple R versions in parallel), or after you have deleted the files. NB: the package names are case-sensitive and the R domain is named inconsistently.

4At the time of writing: use pkgutil --pkgs | grep -i org.r-project to check.

Uninstalling the Tcl/Tk and Texinfo components (which are installed under /opt/R/arm64 on a arm64 build and /opt/R/x86_64 for an x86_64 one) is not as simple. You can list the files they installed in a Terminal by e.g.

pkgutil --files org.r-project.arm64.tcltkpkgutil --files org.r-project.arm64.texinfo

(For the ’Intel build, replace arm64 by x86_64.) These are paths relative to /, the root of the file system.

If you are not compiling R nor installing packages from source you could remove all of /opt/R/arm64 or /opt/R/x86_64.

4.3 Multiple versions

The installer will remove any previous version5 of the R framework which it finds installed. This can be avoided by using pkgutil --forget (see the previous section). However, note that different versions are installed under /Library/Frameworks/R.framework/Versions as 4.4-arm64 (or 4.4-x86_64), 4.3 and so on, so it is not possible to have different 4.x.y versions installed for the same x and CPU type.

5More precisely, of the Apple package of the same name: this means that ARM and Intel versions can be installed together.

R.APP will always run the ‘current’ version of R, that is the last installed version.

Footnotes

4  Installing R under macOS – R Manuals :: R Installation and Administration (2024)
Top Articles
25 Braiders That Stand on Business
Nikki Nicole: The Rising Star In The Music Industry
Uvalde Topic
Here’s how much Tim Ballard made during final months with Operation Underground Railroad
Paradisehilltv
Giant Eagle Hr Conn
Megan Officer
2019 Nissan Altima Wheel Torque Specs
Governing AI for Humanity | Final Report | Digital Watch Observatory
Academic Calendar University Of Tampa
Tsymo Pet Feeder Manual Pdf
Dan Mora Growth
Belle delphine grip tape by New User (Design 568636)
Kaedehara Kazuha: Profile, Strategy & Levelup Guide | Genshin.Global
Hindi Links 4U
Jet Ski Rental Conneaut Lake Pa
Suoiresnu Kemono Party
Sni 35 Wiring Diagram
Noah Schnapp co*ck
Tcp Cypresswood
Terry Flannery Net Worth
Unraid Delete Share
Does Cvs Sell Heavy Whipping Cream
Daddiesbyeze
Ou Class Nav
J Crew Great Lakes Crossing
Greythr Hexaware Bps
Eli Lilly Clarifies It’s Not Offering Free Insulin After Tweet From Fake Verified Account—As Chaos Unfolds On Twitter
The Philadelphia Inquirer from Philadelphia, Pennsylvania
X2 Aspen Everett Ma
Großbritanniens Botschafterin: „Europäische Armee neben Nato ist nicht sinnvoll“
Papa Johns Mear Me
Shop e.chi, Energie Welle, Energie Sohle, E-Smog Kissen, Hologramm
Beau Burns Gofundme
Dislocated Shoulder Bg3
Maps Michigan Login
How do i get all ark skins on PS4?
Restored Republic December 1 2022
Car Cruises, Auto Shows & Club Events in San Diego
Craislist Vt
Ag Carolina Login
Weather Past 3 Days
Papa's Games Unblocked Games
Brooke Monk Twitter Deepfake
Ellafeet.official
Shane Gillis Girlfriend: All About His Dating History, Career & More |Pudelek
Friv4School Unblocked
Goanimate Gina Delgado
How Moneybagg Yo Achieved a Net Worth of $4 Million
Pacific Seed Bank Login
Iwindsurf Forums
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6289

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.