(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (2024)

Table of Contents

Motivation

Whether working or studying everybody uses various sorts and types of software on their computer. Students taking Statistical Courses, as taught by the Mathematical and Statistical Methods group at Wageningen University & Research, will most likely use R.

The instructions in this post will show how to (re-)install R on a desktop or laptop computer running macOS as operating system.

In the text some symbol combinations are used for shortcuts, the following table explains the meaning of these symbols in relation to specific keys on your keyboard. To use the shortcuts press the keyboard keys simultaneously, e.g. ⇧⌘A means ⇧+⌘+A.

IconKeyboard MeaningIconKeyboard Meaning
commandcaps lock
option (or alt)carriage return (return/enter)
controldelete/backspace
fnfunctionforward delete (fn + ⌫)
shift (either left or right)escape

Completely removing R from macOS

If you have previously installed R and wish to re-install the latest version or your current installation is not working as you expect, you first need to delete everything related to R. In macOS a complete removal is somewhat complicated, but doable if you follow all steps precisely as provided in this post.

For the complete removal of everything related to R the Terminal application will be used. In your Finder > Applications (shortcut: ⇧⌘A) there is a Utilities folder as depicted in Figure 1 below.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (1)

Within this Utilities folder, which can be directly accessed by using the ⇧⌘U shortcut, the Terminal application is contained. The icon in Figure 2 shows what the Terminal application looks like in the Finder > Applications > Utilities folder.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (2)

The Terminal application can also be started via Lauchpad under the ‘Other’ group.

Steps for a complete removal of R on macOS:

  1. Start the Terminal application. The terminal console prompt, where the commands will be entered, is depicted by a % or a $ sign. Which sign is shown, depends whether your default shell is zsh (% sign) or bash ($ sign).
  2. To delete the R application copy (⌘C) the following line, paste (⌘V) it behind the terminal console prompt and press return (↩) to execute. Provide the macOS password when asked (the typed password will not be visble!).
sudo rm -r /Applications/R.app
  1. To delete the whole framework running behind R copy (⌘C) the following line, paste (⌘V) it behind the console prompt in the terminal and press return (↩) to execute. No password will be asked anymore, as long as you do not close the terminal application.
sudo rm -r /Library/Frameworks/R.framework
  1. To be able to re-install R the installation receipts need to be removed. This is done by copying (⌘C) the following lines (including the *) one by one, pasting (⌘V) them behind the prompt in the terminal and pressing return (↩) to execute.
sudo rm -r /private/var/db/receipts/org.r-project.*
sudo rm -r /private/var/db/receipts/org.R-project.*
  1. Delete R application support by copying (⌘C) the following line, pasting (⌘V) it behind the prompt in the terminal and pressing return (↩) to execute.
sudo rm -r ~/Library/Application Support/R
  1. Clean the cache of R by copying (⌘C) the following line, pasting (⌘V) it behind the prompt in the terminal and pressing return (↩) to execute.
  1. To remove R preferences copy (⌘C) the following line, paste (⌘V) it behind the prompt in the terminal and press return (↩) to execute.
sudo rm ~/Library/Preferences/org.R-project.org.plist
  1. Deletion of all previously installed user packages is achieved by copying (⌘C) the following line, pasting (⌘V) it behind the prompt in the terminal and pressing return (↩) to execute. A notification will be given in case the folder does not exist.
sudo rm -r ~/Library/R
  1. Delete user created environment variables, used at startup of R, copy (⌘C) the following line, paste (⌘V) it behind the prompt in the terminal and press return (↩) to execute. A notification will be given in case the file does not exist.
sudo rm ~/.Renviron
  1. Finally delete the user folder with additional settings by copying (⌘C) the following line, pasting (⌘V) it behind the prompt in the terminal and pressing return (↩) to execute. A notification will be given in case the folder does not exist.
sudo rm -r ~/.R

Having performed all 10 steps given above, your mac will be ready for a new installation of R. Leave the terminal console open for now, you might need it later on.

Download

At the time this post was written, the latest release of R was version 3.6.3. It has been updated to the latest release version 4.4.1 of R (nicknamed: “Race for Your Life”) for macOS Big Sur or higher.

For newer versions of R than 3.6.3 the steps described below are the same and still correct, but start with a newer version of the downloaded package file of R. The screenshots in this post have not been updated. Therefore, what you see during your installation will differ with respect to the version number shown in the screenshots.

For macOS there are four downloads for R available on the R-project website. To see which version of macOS is installed on your mac, click on in the menu bar and select ‘About This Mac’.

NOTE: If you are using a mac with the newest M1, M2, or M3 processor, download the Apple Silicon arm64 build!

Download R for your specific version of macOS using one of the following links:

macOS Ventura (13.x) users: there is a known bug in Ventura preventing installations from some locations without a prompt. If the installation fails, move the downloaded file away from the Downloads folder (e.g., to your home or Desktop)

Installation

For installing R on macOS follow these steps:

  1. Open the downloaded file, either R-3.6.3.nn.pkg, R-4.2.3.pkg, R-4.4.1-x86_64.pkg, or R-4.4.1-arm64.pkg depending or your version of macOS or processor (as explained above). This file will most likely reside in Finder > Downloads (shortcut: ⌥⌘L). The file can more easily be found by switching into List view (shortcut: ⌘2). To switch to Icon view use the shortcut: ⌘1. The installer package will resemble the image displayed below in Figure 3 (text underneath can, and probably will, differ!).

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (3)

  1. The installler will start and display the introduction as shown below in Figure 4. Click the ‘Continue’ button to proceed.
  1. Now the Read Me for the software to be installed as displayed in Figure 5 below. Click the ‘Continue’ button to proceed.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (5)

  1. Right after the Read Me a Software Licence Agreement will appear. By clicking the ‘Continue’ button you will be asked to agree with this software licence agreement as diplayed below in Figure 6. Click on ‘Agree’ to proceed.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (6)

  1. The installer will select the best destination to install the software for you and will display the Installation Type as shown in Figure 7. Click on the ‘Install’ button to start the software installation.

Do not Customise the installation type, unless you know what you are doing.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (7)

  1. Before the software installation will commence, confirmation of the user is requested as displayed below in Figure 8. Either use the finger print scanner on the touch bar of your mac or confirm using the password of your mac.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (8)

  1. The software installer will start installing R onto your mac. When completed the installer will show a summary stating that the installation was successful as shown in Figure 9 below. Click on the ‘Close’ button.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (9)

  1. The installer will finally ask you whether you want to keep or move to R installer package to the trashbin. Click ‘Move to Bin’ to discard the installer package.

Congratulations 😆, you now have R 3.6.3 or higher installed on your mac! Before actively using the R application, some configuration will be required. The configuration is described in the next section.

Configure the R application on macOS

To configure the R application on macOS perform the following steps:

  1. Start the R application from Finder > Applications (shortcut: ⇧⌘A) or via Launchpad. The icon representing the R application is shown below in Figure 10.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (10)

  1. The R Console will open, as shown in Figure 11 below, and the cursor will be ready for input behind the prompt, indicated by the > sign. In case the R Console displays a non-UTF8 locale warning, than this needs to be remedied first. Go to the section entitled Fix R application non-UTF8 locale warning in this post to resolve this issue.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (11)

  1. Navigate the mouse pointer to the menu bar click on ‘R’ > ‘Preferences…’ (shortcut: ⌘,) to open the R application preferences. The Preferences window displayed in Figure 12 will appear.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (12)

  1. Click on Startup. The Preferences window will change into what is shown in Figure 13.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (13)

  1. Match the Startup settings displayed above in Figure 13. To select the Default CRAN mirror click on the ‘Select’ button. The window shown below in Figure 14 will appear. Select ‘0-Cloud [https]’ and click ‘OK’ to confirm. Having matched the settings, close the window using the red ball in the top left corner of the Startup window.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (14)

  1. Quit the R application either by:

    • Typing q() or quit() behind the R Console prompt (indicated by the > sign) and pressing return (↩) to execute.
    • Using the keyboard shortcut: ⌘Q
    • Navigating the mouse pointer to the menu bar and clicking ‘R’ > ‘Quit R’
    • Navigation the mouse pointer to the top left corner of the R Console window and clicking on the red ball
  2. No matter what you choose, you will always be asked whether you want to save a workspace image as shown below in Figure 15. Just click on the ‘Don’t Save’ button to end the R application.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (15)

Having configured the R application, you are now ready to actively start using it!

Fix R application non-UTF8 locale warning

When the R Console displays a non-UTF8 locale warning at the startup of the R application, it will look like the image shown below in Figure 16.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (16)

The remedy for this issue is not difficult, just perform the following steps:

  1. Go to the open terminal console. If you do not have one yet, open the Terminal application from Finder > Applications > Utilities (shorcut: ⇧⌘U) or via Lauchpad under the ‘Other’ group. The terminal console prompt, where the commands will be entered, is depicted by a % or a $ sign. Which sign is shown, depends whether your default shell is zsh (% sign) or bash ($ sign).
  2. Copy (⌘C) the following line, paste (⌘V) it behind the prompt in the terminal console and press return (↩) to execute the command.
defaults write org.R-project.R force.LANG en_US.UTF-8
  1. Quit the active terminal console by typing exit and pressing return (↩) to execute. To quit the Terminal application completely you can use the keyboard shortcut: ⌘Q or navigate the mouse pointer to the menu bar and click ‘Terminal’ > ‘Quit Terminal’.
  2. Go back to the R Console and quit the R application either by:
    • Typing q() or quit() behind the R Console prompt (indicated by the > sign) and pressing return (↩) to execute.
    • Using the keyboard shortcut: ⌘Q
    • Navigating the mouse pointer to the menu bar and clicking ‘R’ > ‘Quit R’
    • Navigation the mouse pointer to the top left corner of the R Console window and clicking on the red ball
  3. No matter what you choose, you will always be asked whether you want to save a workspace image as shown in Figure 17 below. Just click on the ‘Don’t Save’ button to end the R application.

(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (17)

  1. Go back to step 1. of the Configure the R application on macOS section.
(re-)Installation and Configuration of R on macOS | Maikel P.H. Verouden, Ph.D. (2024)
Top Articles
Stories of Service - World War I Centennial site
Original U.S. WWII Airborne Parachute Pigeon Cage Drop Cage Basket
477 Job Calls
Cars for Sale by Owner in Shreveport, LA
Https://Oneid.securitasinc.com
What I did for an A, by sena1989
Jet Ski Rental Conneaut Lake Pa
Hmr Properties
Emerson Naturals Kratom
Kiddle Encyclopedia
Craigslist Sis
Violent Night Showtimes Near Century 14 Vallejo
Craigslist Lake Of Ozarks Missouri
IBM i Access Client solution
Closest Dollar Tree Store Near Me
Haul auf deutsch: Was ist das? Übersetzung, Bedeutung, Erklärung - Bedeutung Online
Corruption Of Champions 2 Chest Puzzle
M3Gan Showtimes Near Regal City North
Crime | Denver Daily Voice
2068032104
PG&E Outage Center - View Outage Map
A Far Eastern Yarn Ffxiv
Affidavit Of Non Liability Illinois Tollway
Desert Cabinet Odds And Ends
Craigslist Ludington Michigan
Www Craigslist Com Corpus Christi
Whinfell Sso
2021 2 - TEXTO OBRIGATÓRIO 02 - Di Carpegna Falconieri - The Militant Middle Ages - Neuroanatomia
Admissions Process | Broward College
Guide to How Long A Tire Lasts
Angels Pet World Hudson Wi
Livy's Ice Cream
Revit Forums
Who is Social Media Star Desiree Montoya? Her Age, Height, Bio
Ez Rx Of Boynton Beach Llc D Hudson Ohio
Infinite Campus Parent Portal Hall County
What is an employee portal | Deel
Fleet Feet Sports Johnson City Tn
Western Carriers India IPO Closes Today: Subscription Status, GMP, Review - News18
Quest Diagnostics Lake Mary - Employer Drug Testing Not Offered
Ja Rule Net Worth (Money & Salary) 2024
Msc News Atchison Ks
Smithfield Stamp Okta Login
2011 Jeep Liberty Serpentine Belt Diagram
Walmart Beach Lunch Lounge Dress
Indiana Wesleyan Transcripts
2011 Hyundai Sonata 2 4 Serpentine Belt Diagram
Qhc Learning
Pacific Seed Bank Login
Mesh Tape Lowes
E-Pedal And E-Step Systems Will Not Function When ______.
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6291

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.