You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: working_documents/install_r_macos.Rmd
+45-33Lines changed: 45 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ expand or collapse these sections.
18
18
19
19
### Set up R installation directory
20
20
21
+
If you do not have an existing version of R installed on your computer, download
22
+
the installer for the latest release of R from the [CRAN macOS page](https://cran.r-project.org/bin/macosx/) and install this pre-built
23
+
(binary) version with the default settings.
24
+
21
25
Open Terminal.app and follow these instructions:
22
26
23
27
1. Set `LOCAL` as a temporary environment variable to match your architecture
@@ -48,35 +52,53 @@ EOF
48
52
<details><summary><i>Note if using RStudio terminal, or using Terminal.app on macOS < 10.15 (Catalina)...</i></summary> The code above assumes you are using a Zsh shell (the default on macOS ≥ 10.15). If you are using a bash shell, replace <code>.zprofile</code> with <code>.bash_profile</code>. The type of terminal in RStudio can be set in Terminal Options from the terminal or in Global Options.
49
53
</details>
50
54
</details>
51
-
4. If you have previously installed R on the computer, make your account own the existing R framework folder
55
+
4. Make your account own the R framework folder (created when installing R from
Otherwise, download the installer for the latest release of R from CRAN and install with the default settings first.
56
60
57
61
### Install prerequisites
58
62
59
-
1. Install Xcode Command Line Tools from the terminal
60
-
```{sh}
61
-
xcode-select --install
62
-
```
63
-
(If already installed, shows "xcode-select: error: command line tools are
64
-
already installed").
65
-
2. Install GNU Fortran (gfortran) from the binary at
66
-
<https://mac.r-project.org/tools/>.
67
-
3. Install XQuartz from the binary <https://www.xquartz.org/>.
68
-
**Restart your computer** for XQuartz (and components that depend on it) to
69
-
work!
70
-
4. Within R, use the helper R script to install commonly required prerequisites
63
+
For the following instructions, run the code within R:
64
+
65
+
1. Use the helper R script to install commonly required prerequisites
71
66
```{r}
72
67
source("https://mac.R-project.org/bin/install.R")
73
68
install.libs("r-base-dev")
74
69
```
75
-
5. (Optional), within R, install Pango for full Cairo support
70
+
2. (Optional), install Pango for full Cairo support
76
71
```{r}
77
72
install.libs("pango")
78
73
```
79
-
6. Check if you have a current version of MacTeX installed:
74
+
3. Check if you already have Subversion installed:
75
+
76
+
```{r}
77
+
system2("which", "svn")
78
+
```
79
+
80
+
This will print a path where Subversion is installed. If nothing is
81
+
printed, install Subversion:
82
+
83
+
```{r}
84
+
install.libs("subversion", dep = FALSE)
85
+
```
86
+
87
+
<details><summary><i>Troubleshooting...</i></summary> If this does not work, try installing Subversion via your preferred package manager, e.g. with Homebrew: <code>brew install svn</code>.
88
+
</details>
89
+
90
+
For the remaining instructions, run the code within Terminal.app
91
+
92
+
1. Install GNU Fortran (gfortran) from the binary at
93
+
<https://mac.r-project.org/tools/>. This version is prepared for specifically
94
+
for R and will be used in preference to any other version on your system.
95
+
2. From the terminal, install Xcode Command Line Tools
96
+
```{sh}
97
+
xcode-select --install
98
+
```
99
+
(If already installed, shows "xcode-select: error: command line tools are
100
+
already installed").
101
+
3. Check if you have a current version of MacTeX installed:
80
102
```{sh}
81
103
ls /usr/local/texlive
82
104
```
@@ -85,25 +107,15 @@ ls /usr/local/texlive
85
107
2022 2023 texmf-local
86
108
```
87
109
If this check doesn't show a subdirectory for the current year, install MacTex from the binary at <https://tug.org/mactex/mactex-download.html>.
88
-
7. In the terminal, check if you already have Subversion installed:
This will show a path where Subversion is installed, or `svn not found`.
95
-
If necessary, install Subversion from within R:
96
-
97
-
```{r}
98
-
install.libs("subversion", dep = FALSE)
99
-
```
100
-
101
-
<details><summary><i>Troubleshooting...</i></summary> If this does not work, try installing via your preferred package manage, e.g. with Homebrew: <code>brew install svn</code>.
102
-
</details>
103
-
104
-
8. (Recommended) If you are not already using a tool such as [rig](https://github.com/r-lib/rig)
105
-
to install and manage multiple R versions, install RSwitch from <https://rud.is/rswitch/>. These tools are not part of the R Project, but
106
-
make it easy to switch R versions.
114
+
This will show the version number or `could not find /Applications/Utilities/XQuartz.app`. If missing, install XQuartz from the binary at <https://www.xquartz.org/>. **Restart your computer** for XQuartz (and components that depend on it) to work!
115
+
5. (Recommended) If you are not already using a tool such as [rig](https://github.com/r-lib/rig)
116
+
to install and manage multiple R versions, install RSwitch from <https://rud.is/rswitch/>. These are third-party tools, not part of the R
117
+
Project, but are recommended here as they provide an easy way to switch R
0 commit comments