Installing package in R: there is no package called ‘gsl’ - r

I tried to install package copula but incurred error.
I first installed package copula, then tried:
library(copula)
and get:
Show in New WindowClear OutputExpand/Collapse Output
Error: package or namespace load failed for ‘copula’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘gsl’
Then I installed package gsl, restarted R, and tried, following this similar issue:
if(!require(pacman)) install.packages("pacman")
pacman::p_load(copula)
which didn't seem to work. I'm using macOS Big Sur OS.
Edit:
install.packages("gsl")
returned:
There is a binary version available but the source version is later:
Warning in install.packages :
cannot open compressed file '/Users/xxx/.rstudio-desktop/notebooks/3D993D5E-filename/1/8FD36A93A05DA0F7/c6uz0e7whq1or_t/_rs_rdf_111422764b18d.rdf', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
Update:
On 18/05/21, tried
install.packages("copula")
library(copula)
and caught error below:
> install.packages("copula")
also installing the dependency ‘gsl’
There is a binary version available but the source version is later:
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Y
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/copula_1.0-1.tgz'
Content type 'application/x-gzip' length 7335219 bytes (7.0 MB)
==================================================
downloaded 7.0 MB
The downloaded binary packages are in
/var/folders/ll/dvpphrys0pddnjffq7zbl7vm0000gn/T//RtmpRUGsKi/downloaded_packages
installing the source package ‘gsl’
trying URL 'https://cran.rstudio.com/src/contrib/gsl_2.1-6.tar.gz'
Content type 'application/x-gzip' length 189794 bytes (185 KB)
==================================================
downloaded 185 KB
* installing *source* package ‘gsl’ ...
** package ‘gsl’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gsl-config... no
configure: error: gsl-config not found, is GSL installed?
ERROR: configuration failed for package ‘gsl’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/gsl’
Warning in install.packages :
installation of package ‘gsl’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/ll/dvpphrys0pddnjffq7zbl7vm0000gn/T/RtmpRUGsKi/downloaded_packages’
> library(copula)
Error: package or namespace load failed for ‘copula’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘gsl’

Download Homebrew then run
if(!require(pacman)) install.packages("pacman")
pacman::p_load(copula)
seems working for me :)

Related

ggpmisc Error: package or namespace load failed for ‘ggpmisc’

I am trying to use the library ggpmisc and even though the installation went okey it gives me an error when I try to open the library. How can I solve it?
install.packages("ggpmisc")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/ggpmisc_0.4.5.zip'
Content type 'application/zip' length 1349360 bytes (1.3 MB)
downloaded 1.3 MB
package ‘ggpmisc’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\dkafe\AppData\Local\Temp\Rtmpkh620g\downloaded_packages
library(ggpmisc)
Error: package or namespace load failed for ‘ggpmisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘conquer’ In addition: Warning message:
package ‘ggpmisc’ was built under R version 4.1.3

R Studio error calling installed library on windows : there is no package called 'utf8'

I tried to install package ggplot2in R Studio Desktop Windows. But I got the error message when I used the library :
> install.packages("ggplot2")
Installing package into ‘C:/Users/Rifqi/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.3.zip'
Content type 'application/zip' length 4068844 bytes (3.9 MB)
downloaded 3.9 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Rifqi\AppData\Local\Temp\Rtmp005k6i\downloaded_packages
> library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘utf8’
>
What should I do to fix this problem?
Install package utf8 and then try reinstall ggplot2 and it should be fixed
install.packages("utf8")

Error: package or namespace load failed for ‘intsvy’

I am using RStudio Version 1.0.136 – © 2009-2016 RStudio, Inc. I checked for a new update and I received a massege that saying "You're using the newest version of RStudio".
Here I am trying to use R ‘intsvy’ package.
I started by setting up the directory.
Then, first I installed the package by using the following code:
install.packages("intsvy", lib="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
Below is the Console results
There is a binary version available but the source version is later:
binary source needs_compilation
intsvy 2.1 2.4 FALSE
installing the source package ‘intsvy’
trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB
starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
Warning in install.packages :
installation of package ‘intsvy’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’
Second, I installed the package by using the following code after receiving the above long massage:
install.packages("intsvy")
Below is the Console results
Installing package into ‘/Users/HU-Hisham/Library/R/3.3/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
intsvy 2.1 2.4 FALSE
installing the source package ‘intsvy’
trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB
starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Users/HU-Hisham/Library/R/3.3/library/intsvy’
Warning in install.packages :
installation of package ‘intsvy’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’
Next #load backage
library("intsvy")
Below are the massages I received in the Console
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘repr’
In addition: Warning message:
package ‘intsvy’ was built under R version 3.3.2
Error: package or namespace load failed for ‘intsvy’
After installations, I tried to run the following command
pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+ name = "Variable labels", output = getwd())
Here is the massage
Error: could not find function "pirls.var.label"
Function pirls.var.label is one of the functions in the 'intsvy' package.
Why am I receiving this error? Is it because the package not successfully installed? How can I take care or this matter and start using the package and data? Please advice.
I updated my R version from R3.3.1 (2016-06-21) to R3.6.2 (2019-12-12)as some experts recommended.
Then I run the commands again after restarting R:
1 installing repr package
> install.packages("repr")
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES.rds': HTTP status was '404 Not Found'
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/repr_1.0.2.tgz'
Content type 'application/x-gzip' length 118906 bytes (116 KB)
==================================================
downloaded 116 KB
The downloaded binary packages are in
/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages
Warning message:
R graphics engine version 12 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
2 installing intsvy package
> install.packages("intsvy", dependencies = T)
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/intsvy_2.4.tgz'
Content type 'application/x-gzip' length 336356 bytes (328 KB)
==================================================
downloaded 328 KB
The downloaded binary packages are in
/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages
load backage
> library("intsvy")
Error: package or namespace load failed for ‘intsvy’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: there is no package called ‘vctrs’
> library(intsvy)
Error: package or namespace load failed for ‘intsvy’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: there is no package called ‘vctrs’
Still same errors when I try to run the package commands
> pisa.var.lable(folder="~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav")
Error in pisa.var.lable(folder = "~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav") :
could not find function "pisa.var.lable"
> pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+ name = "Variable labels", output = getwd())
Error in pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"), :
could not find function "pirls.var.label"
If you have an idea, please share it here so I can try it to solve this issue and start using the package and PISA data.
Thank you

Install sp package binaries not possible?

> install.packages("sf")
Installing package into ‘C:/Users/koyeli.majumder/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘units’
There are binary versions available but the source versions are later:
binary source needs_compilation
units 0.5-1 0.6-0 FALSE
sf 0.6-1 0.6-3 TRUE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/sf_0.6-1.zip'
Content type 'application/zip' length 39296219 bytes (37.5 MB)
downloaded 37.5 MB
package ‘sf’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\koyeli.majumder\AppData\Local\Temp\Rtmp6LwTYc\downloaded_packages
installing the source package ‘units’
trying URL 'https://cran.rstudio.com/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
downloaded 891 KB
* installing *source* package 'units' ...
** package 'units' successfully unpacked and MD5 sums checked
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
Warning: running command 'make -f "Makevars.win" -f "D:/RStudio/R-3.3.3/etc/x64/Makeconf" -f "D:/RStudio/R-3.3.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="units.dll" WIN=64 TCLBIN=64 OBJECTS="RcppExports.o io.o udunits.o"' had status 127
ERROR: compilation failed for package 'units'
* removing 'C:/Users/koyeli.majumder/Documents/R/win-library/3.3/units'
Warning in install.packages :
running command '"D:/RStudio/R-3.3.3/bin/x64/R" CMD INSTALL -l "C:\Users\koyeli.majumder\Documents\R\win-library\3.3" C:\Users\KOYELI~1.MAJ\AppData\Local\Temp\Rtmp6LwTYc/downloaded_packages/units_0.6-0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘units’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\koyeli.majumder\AppData\Local\Temp\Rtmp6LwTYc\downloaded_packages’
> library(sf)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘units’
Error: package or namespace load failed for ‘sf’
At first I was unable to install also but after I uninstalled rgdal package, I could install sf package. But I'm unable to load it. Results in below error.
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘units’
Error: package or namespace load failed for ‘sf’
I'm unable to load package units also separately. I have a Windows 7 64 bit system.
Answer goes out to #Ralf Stubner.
You install units dependency package latest version. To compile sources into binaries you need to have installed Rtools package.
As an alternative you can use install.packages function with argument type = "binary" to install the older available binary package.
install.packages("units", type = "binary")

R Package installed but cannot be loaded?

I installed the "digest" package in R.
> install.packages("digest")
Installing package into ‘C:/Users/user/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://mran.microsoft.com/snapshot/2017-03-15/bin/windows/contrib/3.3/digest_0.6.12.zip'
Content type 'application/zip' length 172746 bytes (168 KB)
downloaded 168 KB
package ‘digest’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘digest’
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\RtmpaMPhK6\downloaded_packages
I confirmed that this package is installed in:
C:\Program Files\R\R-3.3.2\library\digest
My repos are:
getOption("repos")
CRAN CRANextra
"https://mran.microsoft.com/snapshot/2017-03-15" "http://www.stats.ox.ac.uk/pub/RWin"
Then I wanted to install "kableExtra" package. But I am getting an error message that the there is no "digest":
> library(kableExtra)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘digest’
Error: package or namespace load failed for ‘kableExtra’
What is wrong? Is this due to the fact that the original library is from CRAn, but for some reason this "digest" package is coming from MRAN? How can I fix this?

Resources