Impossible to use R - r

Im having trouble to install any package after downloading the last R update. The errors always look like this:
ERROR: dependencies ‘ellipsis’, ‘glue’, ‘vctrs’ are not available for package ‘tidyselect’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/tidyselect’
Warning in install.packages :
installation of package ‘tidyselect’ had non-zero exit status
Also it appears an error such as this:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘backports’
Anyone has any idea how i can change this?

Related

Error installing dplyr library in R v4.2.2

I have updated my R version, and then updated my Rstudio, and now I am trying to install library(dplyr), but I get the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘vctrs’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/vctrs’
Warning in install.packages :
installation of package ‘vctrs’ had non-zero exit status
and when I try installing the library(vctrs) as #MrFlick suggested, and run library(dplyr) again, it shows that a dependency called 'xfun' is not installed. When I try...
** package ‘xfun’ 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 ‘xfun’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/xfun’
Warning in install.packages :
installation of package ‘xfun’ had non-zero exit status

RStudio: Problem installing tibble as dependency for Bchron

I've been trying to install Bchron for use with my dissertation data, and tibble is apparently one of the dependencies it needs. I'm fairly new to R so don't understand most of this, but I get pretty much the same error whether I try to install Bchron, tidyverse, or just tibble alone. Here's the error text (apologies if it's not conventionally formatted); any help would be appreciated:
Installing tibble [3.1.1] ...
FAILED
Error installing package 'tibble':
==================================
* installing to library ‘/Users/timdennehymac/Dropbox (Personal)/Dissertation/Chronology/Bchron3_TY/renv/staging/1’
* installing *source* package ‘tibble’ ...
** package ‘tibble’ 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
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘tibble’
* removing ‘/Users/timdennehymac/Dropbox
(Personal)/Dissertation/Chronology/Bchron3_TY/renv/staging/1/tibble’
Error: install of package 'tibble' failed [error code 1]
In addition: Warning messages:
1: /usr/bin/xcrun --find --show-sdk-path returned exit code 1
2: In system2(R(), args, stdout = TRUE, stderr = TRUE) :
running command ''/Library/Frameworks/R.framework/Resources/bin/R' CMD config CC 2>&1' had status 1
3: In if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
the condition has length > 1 and only the first element will be used
4: In if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
the condition has length > 1 and only the first element will be used
The tibble package was updated yesterday to version 3.1.1.
There is not yet any binary available for this version, even on the Rstudio CRAN mirror so you will need to compile the package yourself.
Since you appear to be running MacOS, you will need to install the Xcode command line tools in order to be able to build packages.
Open terminal.app and type the following command:
xcode-select --install
Follow the on screen prompts.
Once the command line utilities have been installed. Close R, restart and try again.

Problem installing LambertW package for R

I'm trying to install the LambertW package for R (or any package that will give me the Lambert W function). Everytime I try:
install.packages("LambertW")
I get this output...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error in read_r_config(sprintf("%sFLAGS", cxx), envir = NULL)[[1]] :
subscript out of bounds
Calls: source_file -> eval -> eval
Execution halted
ERROR: configuration failed for package ‘RcppParallel’
* removing ‘/usr/local/lib/R/3.6/site-library/RcppParallel’
Warning in install.packages :
installation of package ‘RcppParallel’ had non-zero exit status
ERROR: dependency ‘RcppParallel’ is not available for package ‘lamW’
* removing ‘/usr/local/lib/R/3.6/site-library/lamW’
Warning in install.packages :
installation of package ‘lamW’ had non-zero exit status
ERROR: dependency ‘lamW’ is not available for package ‘LambertW’
* removing ‘/usr/local/lib/R/3.6/site-library/LambertW’
Warning in install.packages :
installation of package ‘LambertW’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/4m/qkbb2hwd1t12v_11mjcphv300000gn/T/RtmpcUm3LQ/downloaded_packages’
Then if I try to load it using library I get this
library("LambertW")
Error in library("LambertW") : there is no package called ‘LambertW’
Does anyone know how to solve this?

How to solve Issues with installation of 'rlang' package?

I am trying to install Tidyverse but I cannot get the rlang package to download.
I am using R version 3.5.3, and I have tried uninstalling and reinstalling R. Furthermore, I have tried to install Tidyverse as well as the rlang package individually.
install.packages("tidyverse")
install.packages("rlang", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
With both of these methods, I get the same error message.
* installing *source* package ‘rlang’ ...
** package ‘rlang’ 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 ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rlang’
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status
Any ideas would be greatly appreciated!

tsoutliers dependency issue: dependency KFKSDS has non-zero exit status?

While working on outlier detection on a time series data. I came across [tsoutliers][1] packages that does implement Chen and Liu's time series outlier detection. But I am unable to install tsoutliers in R
install.packages("tsoutliers")
I am getting the following dependency errors
In file included from KF-deriv.cpp:1:0: KFKSDS.h:14:28: fatal error:
gsl/gsl_vector.h: No such file or directory compilation terminated.
/usr/lib/R/etc/Makeconf:143: recipe for target 'KF-deriv.o' failed
make: *** [KF-deriv.o] Error 1 ERROR: compilation failed for package
‘KFKSDS’
* removing ‘/home/atoffy/R/x86_64-pc-linux-gnu-library/3.2/KFKSDS’ Warning in install.packages : installation of package ‘KFKSDS’ had
non-zero exit status ERROR: dependency ‘KFKSDS’ is not available for
package ‘stsm’
* removing ‘/home/atoffy/R/x86_64-pc-linux-gnu-library/3.2/stsm’ Warning in install.packages : installation of package ‘stsm’ had
non-zero exit status ERROR: dependencies ‘stsm’, ‘KFKSDS’ are not
available for package ‘tsoutliers’
* removing ‘/home/atoffy/R/x86_64-pc-linux-gnu-library/3.2/tsoutliers’ Warning in install.packages : installation of package ‘tsoutliers’
had non-zero exit status
More specifically
recipe for target 'KF-deriv.o' failed
Can anyone help me to install the same?
I was able to solve the same by installing
libgsl0
sudo apt-get install libgsl0-dev

Resources