Rnotebook Error

I have rstudio desktop. When I am trying to run
File > New File > R Notebook

I get an error : unable to install package ' digest '

Have you tried to install digest manually? do you get any error message? This is the command to install the package.


Yes, getting same error

> install.packages('digest')

  There is a binary version available but the
  source version is later:
       binary source needs_compilation
digest 0.6.21 0.6.22              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) YES
installing the source package ‘digest’

trying URL 'https://cran.cnr.berkeley.edu/src/contrib/digest_0.6.22.tar.gz'
Content type 'application/x-gzip' length 141968 bytes (138 KB)
downloaded 138 KB

* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c SpookyV2.cpp -o SpookyV2.o
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
SpookyV2.cpp:14:10: fatal error: 'memory.h' file not found
#include <memory.h>
1 error generated.
make: *** [SpookyV2.o] Error 1
ERROR: compilation failed for package ‘digest’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest’
Warning in install.packages :
  installation of package ‘digest’ had non-zero exit status

The downloaded source packages are in

Some times is hard to compile packages from source on macOS if you don't need the latest version, try installing the binary version by answering "No" when asked if you want to install from source.

If for some reason you need to install the latest version from source, then the first thing to try is to update Xcode in your system

xcode-select --install

Here are some installation instructions


Thanks alot andresrc, that worked

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.