RMarkdown ERROR: compilation failed for package ‘yaml’ - r

I updated R to the latest version "R version 3.3.3 (2017-03-06)". I am using macOS Mojave.
Now, when I am trying to knit the code in the Markdown, I get an error. I figured this is because I don't have an updated version of the "yaml" package. However, when I am trying to update the "yaml" package, I get the following errors:
installing the source package ‘yaml’
trying URL 'https://cran.rstudio.com/src/contrib/yaml_2.2.0.tar.gz'
Content type 'application/x-gzip' length 89447 bytes (87 KB)
==================================================
downloaded 87 KB
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2019a.1.0/zoneinfo/America/Chicago'
* installing *source* package ‘yaml’ ...
** package ‘yaml’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘yaml’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/yaml’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/yaml’
Warning in install.packages :
installation of package ‘yaml’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/_r/cgv1gmqx1vzgv25k1k805lyw0000gn/T/RtmpagnKIL/downloaded_packages’

Related

Trouble executing the MCMCpack on R

I have installed the 'MCMCpack' package on my R using the code install.packages("MCMCpack") successfully.
also installing the dependency ‘quantreg’
There are binary versions available but the source versions are later:
binary source needs_compilation
quantreg 5.85 5.94 TRUE
MCMCpack 1.6-0 1.6-3 TRUE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) Yes
installing the source packages ‘quantreg’, ‘MCMCpack’
trying URL 'https://cran.rstudio.com/src/contrib/quantreg_5.94.tar.gz'
Content type 'application/x-gzip' length 1025290 bytes (1001 KB)
==================================================
downloaded 1001 KB
trying URL 'https://cran.rstudio.com/src/contrib/MCMCpack_1.6-3.tar.gz'
Content type 'application/x-gzip' length 1030533 bytes (1006 KB)
==================================================
downloaded 1006 KB
* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘quantreg’ is not available for package ‘MCMCpack’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/MCMCpack’
Warning in install.packages :
installation of package ‘MCMCpack’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/xp/077px4z927d5jplc0wg9701r0000gn/T/RtmpAgOlHz/downloaded_packages’
But when I enter library(MCMCpack), it returns this error message:
Error in library("MCMCpack") : there is no package called ‘MCMCpack’
What might be the problem here? There seems no issue in installing the package beforehand.
I have installed the 'MCMCpack' package on my R using the code install.packages("MCMCpack") successfully.
No, your installation of MCMCpack was unsuccessful, as is clearly indicated by the error & warning messages.
Of note,
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
This is usually the result of the Command Line Tools not having been installed (correctly). You can install the Xcode Command Line Tools with
xcode-select --install
Then re-issue
install.packages("MCMCpack")

Cannot install package Rdpack due to error "had non-zero exit status"

I am using RStudio 2022.02.3 Build 492 for mac. I am trying to install the package Rdpack as a requirement to load another package and it does not work. Could you please help to tell me what the problem is and what I should do to solve it. And here is the error message I received:
install.packages('Rdpack')
also installing the dependency ‘rbibutils’
There are binary versions available but the source versions are later:
binary source needs_compilation
rbibutils 2.2.7 2.2.8 TRUE
Rdpack 2.3 2.3.1 FALSE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source packages ‘rbibutils’, ‘Rdpack’
trying URL 'https://cran.rstudio.com/src/contrib/rbibutils_2.2.8.tar.gz'
Content type 'application/x-gzip' length 882817 bytes (862 KB)
==================================================
downloaded 862 KB
trying URL 'https://cran.rstudio.com/src/contrib/Rdpack_2.3.1.tar.gz'
Content type 'application/x-gzip' length 703156 bytes (686 KB)
==================================================
downloaded 686 KB
* installing *source* package ‘rbibutils’ ...
** package ‘rbibutils’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘rbibutils’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rbibutils’
Warning in install.packages :
installation of package ‘rbibutils’ had non-zero exit status
ERROR: dependency ‘rbibutils’ is not available for package ‘Rdpack’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rdpack’
Warning in install.packages :
installation of package ‘Rdpack’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/r2/_r7yln992kq1x9pg298ql_s40000gn/T/RtmpMko8Ru/downloaded_packages’
Thank you so much for your help!

Unable to install "RecordLinkage" in R version 3.5.0 on MacOs

I am trying to install package "RecordLinkage" in Mac but I get this error message.
I already tried to type "no" for "Do you want to attempt to install these from sources?" and it does not work either.
Any advice/suggestions, please?
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘RecordLinkage’
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source package ‘RecordLinkage’
trying URL 'https://cran.rstudio.com/src/contrib/RecordLinkage_0.4-12.1.tar.gz'
Content type 'application/x-gzip' length 759438 bytes (741 KB)
==================================================
downloaded 741 KB
* installing *source* package ‘RecordLinkage’ ...
** package ‘RecordLinkage’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘RecordLinkage’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RecordLinkage’
Warning in install.packages :
installation of package ‘RecordLinkage’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/sp/jy_rk5ts16sbrlkd2mbpg0m00000gn/T/RtmpDWiWEt/downloaded_packages’

Issues installing devtools in R

Trying to install devtools, but keep getting the error
Error : object ‘glue_collapse’ is not exported by 'namespace:glue'
ERROR: lazy loading failed for package ‘usethis’
Below is the full error code:
> install.packages('devtools', repos='http://cran.rstudio.com/')
also installing the dependency ‘usethis’
There are binary versions available but
the source versions are later:
binary source needs_compilation
usethis 1.4.0 1.5.0 FALSE
devtools 1.13.6 2.0.2 FALSE
installing the source packages ‘usethis’, ‘devtools’
trying URL 'http://cran.rstudio.com/src/contrib/usethis_1.5.0.tar.gz'
Content type 'application/x-gzip' length 393903 bytes (384 KB)
==================================================
downloaded 384 KB
trying URL 'http://cran.rstudio.com/src/contrib/devtools_2.0.2.tar.gz'
Content type 'application/x-gzip' length 388141 bytes (379 KB)
==================================================
downloaded 379 KB
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘usethis’ ...
** package ‘usethis’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error : object ‘glue_collapse’ is not exported by 'namespace:glue'
ERROR: lazy loading failed for package ‘usethis’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
ERROR: dependency ‘usethis’ is not available for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/6m/np7rbj6d6hv6xf8y_9x5pq000000gn/T/Rtmp8PDiFb/downloaded_packages’
I've installed tidyverse which has the glue package encompassed within it, but still getting issues with glue_collapse. Additionally, is it possible to turn off lazy loading to fix the 'usethis' dependency issue? Tried searching ways, but no successful methods.
Adding my original comment as an answer to mark this resolved. Turns out I needed to install the glue package separately, which then fixed the usethis issue.

Issue installing rDEA - compilation failed for package

I'm trying to use the package rDEA. I have most recent r version 3.4.4 ("Someone to Lean On"). I'm using most recent R Studio 1.1.423.
I get the error compilation failed for package 'rDEA'. Can anyone help?
Precise details:
install.packages("rDEA")
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘rDEA’
Do you want to attempt to install these from sources?
y/n:
I type y, and get the following:
installing the source package ‘rDEA’
trying URL 'https://cran.rstudio.com/src/contrib/rDEA_1.2-5.tar.gz'
Content type 'application/x-gzip' length 57007 bytes (55 KB)
==================================================
downloaded 55 KB
* installing *source* package ‘rDEA’ ...
** package ‘rDEA’ successfully unpacked and MD5 sums checked
** libs
/bin/sh: line 0: cd: GLPK: No such file or directory
make: *** [GLPK.ts] Error 1
ERROR: compilation failed for package ‘rDEA’
* removing
‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rDEA’
Warning in install.packages :
installation of package ‘rDEA’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/b1/_pstgqks0r3gb3t972tk8zh00000gn/T/RtmpuvqGid/downloaded_packages’

Resources