A few weeks ago, I bought a new MacBook Pro for work. It is the Apple M2 Max. I transferred everything from my iMac which has an M1 chip. It's interesting that on the iMac, I have none of the problems I'm about to report, which makes me think it's either the chip or the transfer installation. The short version of my problem is that while I have many packages already installed when I installed R on the new computer, I am frequently unable to install any new packages. I've found little to no advice from people at work who know R better than me, and I've gone round and round with GPT-4, so now I'm going to try talking to experts. Here is the version of R I'm running:
platform aarch64-apple-darwin22.4.0
arch aarch64
os darwin22.4.0
system aarch64, darwin22.4.0
status
major 4
minor 3.0
year 2023
month 04
day 21
svn rev 84292
language R
version.string R version 4.3.0 (2023-04-21)
nickname Already Tomorrow
And here is a simple install error I got from trying to install ggplot2.
install.packages("ggplot2", dependences=TRUE)
Installing package into ‘/Users/scott_cunningham/Library/R/arm64/4.3/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘farver’, ‘isoband’, ‘scales’
- installing source package ‘farver’ ...
** package ‘farver’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘Homebrew clang version 16.0.2’
using C++11
using SDK: ‘’
clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.0/lib/R/include" -DNDEBUG -I/opt/homebrew/Cellar/gettext/0.21.1/include -fPIC -g -O2 -c ColorSpace.cpp -o ColorSpace.o
In file included from ColorSpace.cpp:1:
In file included from ./ColorSpace.h:4:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/typeinfo:61:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/exception:81:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/__memory/base.h:14:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/__debug:14:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/iosfwd:95:
/Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^~~~~~~~~
1 error generated.
make: *** [/opt/homebrew/Cellar/r/4.3.0/lib/R/etc/Makeconf:198: ColorSpace.o] Error 1
ERROR: compilation failed for package ‘farver’ - removing ‘/Users/scott_cunningham/Library/R/arm64/4.3/library/farver’
Warning in install.packages :
installation of package ‘farver’ had non-zero exit status - installing source package ‘isoband’ ...
** package ‘isoband’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘Homebrew clang version 16.0.2’
using C++11
using SDK: ‘’
clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.0/lib/R/include" -DNDEBUG -I/opt/homebrew/Cellar/gettext/0.21.1/include -fPIC -g -O2 -c clip-lines.cpp -o clip-lines.o
In file included from clip-lines.cpp:3:
In file included from /opt/homebrew/Cellar/r/4.3.0/lib/R/include/R.h:39:
In file included from /Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/cstdlib:85:
/Users/scott_cunningham/opt/anaconda3/bin/../include/c++/v1/stdlib.h:93:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
^~~~~~~~~~
1 error generated.
make: *** [/opt/homebrew/Cellar/r/4.3.0/lib/R/etc/Makeconf:198: clip-lines.o] Error 1
ERROR: compilation failed for package ‘isoband’ - removing ‘/Users/scott_cunningham/Library/R/arm64/4.3/library/isoband’
Warning in install.packages :
installation of package ‘isoband’ had non-zero exit status
ERROR: dependency ‘farver’ is not available for package ‘scales’ - removing ‘/Users/scott_cunningham/Library/R/arm64/4.3/library/scales’
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘isoband’, ‘scales’ are not available for package ‘ggplot2’ - removing ‘/Users/scott_cunningham/Library/R/arm64/4.3/library/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/9d/_2mr739j3sz0szn1f4fsypss5n8_l0/T/RtmpGzRmDW/downloaded_packages’
I was hoping someone might have some ideas? I'm really frustrated and lost.