Unable to install warbleR package using Mac OS - r

When trying to install the warbleR package, I keep getting this error message:
> install.packages("warbleR")
also installing the dependency ‘bioacoustics’
There is a binary version available but the source version is later:
binary source needs_compilation
warbleR 1.1.14 1.1.15 FALSE
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘bioacoustics’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source packages ‘bioacoustics’, ‘warbleR’
trying URL 'https://cran.rstudio.com/src/contrib/bioacoustics_0.1.5.tar.gz'
Content type 'application/x-gzip' length 834645 bytes (815 KB)
==================================================
downloaded 815 KB
trying URL 'https://cran.rstudio.com/src/contrib/warbleR_1.1.15.tar.gz'
Content type 'application/x-gzip' length 2348150 bytes (2.2 MB)
==================================================
downloaded 2.2 MB
* installing *source* package ‘bioacoustics’ ...
** package ‘bioacoustics’ successfully unpacked and MD5 sums checked
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
configure: CXX: clang++ -std=gnu++11
checking for cmake... not found
configure: error: Could not find cmake
ERROR: configuration failed for package ‘bioacoustics’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/bioacoustics’
Warning in install.packages :
installation of package ‘bioacoustics’ had non-zero exit status
ERROR: dependency ‘bioacoustics’ is not available for package ‘warbleR’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/warbleR’
Warning in install.packages :
installation of package ‘warbleR’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/z9/6d_1kkxd0jxcj0r88hng7crm0000gn/T/RtmpSUXFDU/downloaded_packages’
>

As #neilfws pointed out, this could be solved with homebrew running brew install cmake.

Related

How to download Sf package on MacOS

I tried a couple of hours to install sf package (on MacOs) by using most of the solutions I encountered on the web but still, it did not work. Let me show, what I did and then what the problem is step by step.
First, I tried the normal thing install.packages("sf") which resulted in the following error.
URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/sf_1.0-2.tgz' deneniyor
Content type 'application/x-gzip' length 93022013 bytes (88.7 MB)
====================================
downloaded 65.3 MB
Warning in install.packages :
downloaded length 68510897 != reported length 93022013
Warning in install.packages :
URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/sf_1.0-2.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) :
download from 'https://cran.rstudio.com/bin/macosx/contrib/4.1/sf_1.0-2.tgz' failed
Warning in install.packages :
download of package ‘sf’ failed
Following that, I tried to comply with the instructions in this website https://github.com/r-spatial/sf. To this end, I first installed home brew and then rendered these two codes on the MacOS terminal.
brew install pkg-config
brew install gdal
And, finally, in line with the website's suggestion, I run this code to install rgdal package to get sf installed.
install.packages("rgdal", configure.args = c("--with-proj-lib=/usr/local/lib/", "--with-proj-include=/usr/local/include/"))
However, it came with the following error.
There is a binary version available but the source version is later:
binary source needs_compilation
rgdal 1.5-26 1.5-27 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘rgdal’
URL 'https://cran.rstudio.com/src/contrib/rgdal_1.5-27.tar.gz' deneniyor
Content type 'application/x-gzip' length 4391149 bytes (4.2 MB)
==================================================
downloaded 4.2 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++14
configure: CFLAGS: -Wall -g -O2
configure: CPPFLAGS: -I/usr/local/include
configure: CXXFLAGS: -Wall -g -O2
configure: LDFLAGS: -L/usr/local/lib
configure: LDFLAGS: -L/usr/local/lib
configure: CXX11 is: clang++ -mmacosx-version-min=10.13, CXX11STD is: -std=gnu++11
configure: CXX is: clang++ -mmacosx-version-min=10.13 -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.5-27
checking for /usr/bin/svnversion... no
configure: svn revision: 1148
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/tc/g15hmz9s0hg1nxmh7_4mw9lm0000gn/T/RtmplfPV9h/downloaded_packages’
As suggested in this website https://github.com/r-spatial/sf, I alternatively tried the solutions in https://github.com/r-spatial/sf/issues/1536#issuecomment-727342736.
Yet, in the part 2, when I run this code chunk,
install.packages("rgeos", repos="http://R-Forge.R-project.org", type="source")
install.packages("rgdal", repos="http://R-Forge.R-project.org", type="source")
library(devtools)
install_github("r-spatial/sf", configure.args = "--with-proj-lib=/usr/local/lib/")
A similar problem emerged for all these codes. For instance, for the first one, the error was;
URL 'http://R-Forge.R-project.org/src/contrib/rgeos_0.5-8.tar.gz' deneniyor
Content type 'application/x-gzip' length 276303 bytes (269 KB)
==================================================
downloaded 269 KB
* installing *source* package ‘rgeos’ ...
** using staged installation
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++14
configure: rgeos: 0.5-7
checking for /usr/bin/svnversion... no
cat: inst/SVN_VERSION: No such file or directory
configure: svn revision:
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgeos’
Warning in install.packages :
installation of package ‘rgeos’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/tc/g15hmz9s0hg1nxmh7_4mw9lm0000gn/T/RtmplfPV9h/downloaded_packages’
And lastly, I followed the instructions to solve this problem on this website; trouble installing "sf" due to "gdal"
First: gdalinfo --version code resulted in GDAL 3.3.2, released 2021/09/01
Second, I did brew unlink gdal, yet when I run brew link --force gdal2, it did not work. (I am a new user so I assumed it might be because of different versions but when I tried brew link --force gdal3.3.2, it gave me the error Error: No such keg: /opt/homebrew/Cellar/gdal3.3.2.
So, if you can help me how to install sf on MacOS, I will be very glad for that.
The error message lines "Warning in install.packages : downloaded length 68510897 != reported length 93022013" and "Timeout of 60 seconds was reached" suggests the package didn't download properly - this can occur when it takes longer than 60 seconds to download the package to your computer for installation i.e. the "timeout" of 60 seconds is reached.
One solution (the solution that worked in this case) is to increase the amount of time R will wait to download the package by running options(timeout = 1200) before running install.packages("sf")
If you need to build packages from source (with or without openMP) on an M1 mac, I believe the instructions posted here work: https://stackoverflow.com/a/68275558/12957340
Not sure if this is helpful, but I was having similar trouble getting this installed on a fresh Mac. I ended up installing XQuartz (which I didn't have), downloading homebrew to get PROJ, and then reinstalling R (50/50 as to whether I downloaded the right version for my M1 Mac) and got everything installed properly.

Cannot install Stringi for R (R-studio 1.1.456, OS X 10.15.2 Catalina)

I get the following error when trying to install stringi:
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.4.5.tar.gz'
Content type 'application/x-gzip' length 7284255 bytes (6.9 MB)
==================================================
downloaded 6.9 MB
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /Users/USER/Anaconda3/anaconda3/lib/R
checking for R... /Users/USER/Anaconda3/anaconda3/lib/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu61/data
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpWRiuI3/R.INSTALL116de6e601bb4/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/stringi’
* restoring previous ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
I have seen that this has been an issue in the past, eg. here where there is a clash with Makevars, but I don't have Makevars installed so that cannot be it. (I tried to install the package as a binary but got: "package ‘stringi’ is available as a source package but not as a binary").
Thanks!
Edit: I changed the title to install from update. The package was somehow removed and now I can't install it, or run rmarkdown...

Cannot install rgl package

I am running RStudio on Digital Ocean. I want to install a package called rgl. The goal is to install this package without using sudo code. I also tried installing the dependency package 'magick' but no luck. Anyone try this in the past?
I also cannot download xquartz since this in running on digital ocean. That has been an answer I've been researching in order to solve this.
This is the error:
install.packages("rgl", dependencies = TRUE)
Installing package into ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘magick’
trying URL 'https://cran.rstudio.com/src/contrib/magick_2.0.tar.gz'
Content type 'application/x-gzip' length 4998781 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
trying URL 'https://cran.rstudio.com/src/contrib/rgl_0.99.16.tar.gz'
Content type 'application/x-gzip' length 3058794 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because Magick++ was not found. Try installing:
- deb: 'libmagick++-dev' (Debian, Ubuntu)
- rpm: 'ImageMagick-c++-devel' (Fedora, CentOS, RHEL)
- csw: 'imagemagick_dev' (Solaris)
On MacOS it is recommended to use install ImageMagick-6 from homebrew
with extra support for fontconfig and rsvg rendering:
brew reinstall imagemagick#6 --with-fontconfig --with-librsvg
For older Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
sudo add-apt-repository -y ppa:opencpu/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
installation of package ‘magick’ had non-zero exit status
* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8fiUj6/downloaded_packages’

Cannot install packages to R after brew install

I've spent about an hour trying to debug this, but I think it's best to assume I haven't tried anything except brew install r and install.packages("tidycensus") and a few other packages to check if it was tidycensus specifically.
Let me know if there's any information I can provide. I recently wiped the hard drive of my fairly new Mac and started fresh.
The output of install.packages("tidycensus"):
> install.packages("tidycensus")
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB
trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpPtsVPP/R.INSTALLf8694f0bf387/units':
configure: error:
--------------------------------------------------------------------------------
libudunits2.so not found!
If the udunits2 library is installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
for example, if the library was not found, and/or
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values for your
installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
The downloaded source packages are in
‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
installation of package ‘tidycensus’ had non-zero exit status
> install.packages('tidycensus')
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB
trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpuOGf6j/R.INSTALLfdd5361d965a/units':
configure: error:
--------------------------------------------------------------------------------
libudunits2.so not found!
If the udunits2 library is installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
for example, if the library was not found, and/or
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values for your
installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
The downloaded source packages are in
‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
installation of package ‘tidycensus’ had non-zero exit status
Worked fine for me. Possible solutions:
Check that you have ggplot installed via github install_github("tidyverse/ggplot2")
Confirm that your R-Version is ≥ 3.3.0
Install package via github install_github("walkerke/tidycensus")
Check other dependencies
My problem was that I had a few stray python3 config files floating around after a non-brew install of python3. I removed python3 and reinstalled with brew.
My recommendation to users having the same problem is to run brew doctor. If you are having the same problem I was, your python3 config files will be displayed as issues, and you can uninstall python3 and reinstall it with brew install python3.
I then had a few dependencies I had to work through, some in R, and some in brew.
#comfort eagle 's suggestion of using install_github() after installing and importing devtools was also helpful.

Difficulty installing GTK 2.8 Mac OS X 10.12.6 for installing Rattle package in R.

I only want to install the Rattle package and its dependencies in R, though I got that GTK 2.8 is required. Since I'm not a programmer I went the most simple route and ran homebrew but it installed GTK 2.24.
Now I get this error instead [full code]
> install.packages("rattle")
also installing the dependency ‘RGtk2’
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘RGtk2’
Do you want to attempt to install these from sources?
y/n: n
installing the source package ‘rattle’
trying URL 'https://cran.rstudio.com/src/contrib/rattle_4.1.0.tar.gz'
Content type 'application/x-gzip' length 2665410 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
ERROR: dependency ‘RGtk2’ is not available for package ‘rattle’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rattle’
Warning in install.packages :
installation of package ‘rattle’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/gz/hgc4y87s16gcg7q7b6fgq1hc0000gn/T/RtmpXbOVK8/downloaded_packages’
> install.packages("RGtk2")
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘RGtk2’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RGtk2’
trying URL 'https://cran.rstudio.com/src/contrib/RGtk2_2.20.33.tar.gz'
Content type 'application/x-gzip' length 2792938 bytes (2.7 MB)
==================================================
downloaded 2.7 MB
* installing *source* package ‘RGtk2’ ...
** package ‘RGtk2’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... yes
checking for GTHREAD... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for uintptr_t... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -D_R_=1 -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.31_1/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.31_1/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/1.4.8_1/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.10/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/atk/2.24.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.10/include/cairo -I/usr/local/Cellar/pixman/0.34.0_1/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.12.4/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.36.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/glib/2.52.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.52.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.41/include -I. -DHAVE_UINTPTR_T -I/usr/... <truncated>
RGtkDataFrame.c:502:1: warning: unused function 'r_gtk_data_frame_remove' [-Wunused-function]
r_gtk_data_frame_remove (RGtkDataFrame *data_frame,
^
1 warning generated.
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -D_R_=1 -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.31_1/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.31_1/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/1.4.8_1/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.10/include -I/usr/local/Cellar/pango/1.40.9/include/pango-1.0 -I/usr/local/Cellar/atk/2.24.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.10/include/cairo -I/usr/local/Cellar/pixman/0.34.0_1/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.12.4/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.36.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.31/include/libpng16 -I/usr/local/Cellar/glib/2.52.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.52.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.41/include -I. -DHAVE_UINTPTR_T -I/usr/... <truncated>
Rgtk.c:7:10: fatal error: 'gdk/gdkx.h' file not found
#include <gdk/gdkx.h>
^
1 error generated.
make: *** [Rgtk.o] Error 1
ERROR: compilation failed for package ‘RGtk2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RGtk2’
Warning in install.packages :
installation of package ‘RGtk2’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/gz/hgc4y87s16gcg7q7b6fgq1hc0000gn/T/RtmpXbOVK8/downloaded_packages’
How do i update GTK from 2.24 to 2.8? Homebrew apparently always installs 2.24.
Also, should I install 2.8 or any version above it should work? Usually updated is better - in consumer stuff at least.
Is there a simple guideline for users not very accustomed to terminal on how to do this? I found https://www.hardcoded.net/devlogs/20120426 but simple copy pasting does not work and I'm not comfortable messing around with stuff like this in terminal.

Resources