Error installing the R package: CBNplot on github - r

I want to install the CBNplot package on GitHub:
Making the website:https://github.com/noriakis/CBNplot
Try two methods:
The first is direct download:
The following error occurs:
devtools::install_github("noriakis/CBNplot")
Installing package into ‘C:/Users/sjadsqf/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
installing source package 'CBNplot' ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
Execution halted
ERROR: lazy loading failed for package 'CBNplot'
removing 'C:/Users/sjadsqf/Documents/R/win-library/4.1/CBNplot'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/sjadsqf/AppData/Local/Temp/RtmpMHHiTR/file555833c63074/CBNplot_0.99.2.tar.gz’ had non-zero exit status
Then I tried the second method
pkgbuild::build("D:/R/CBNplot-main",
dest_path = "D:/R/library/")
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
Execution halted
ERROR: lazy loading failed for package 'CBNplot'
removing 'C:/Users/sjadsqf/AppData/Local/Temp/Rtmp2F15K6/Rinst5c845a222d2f/CBNplot'
-----------------------------------
ERROR: package installation failed
Error in (function (command = NULL, args = character(), error_on_status = TRUE, ...:
! System command 'Rcmd.exe' failed
Exit status: 1
stdout & stderr:
i notice that error
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
So I tried to install belearn,After the installation is complete, the above error still appears in the operation

If you look at the changelog for the package bnlearn, it says
Version 4.8
...
removed choose.direction().
The lastest version of bnlearn therefore does not have the choose.direction function that the earlier versions had. Obviously, the CBNplot package uses this function, so the update in bnlearn has effectively broken the existing version of CBNplot.
The solution is to install an earlier version of bnlearn. For example, if I do
remove.packages('bnlearn')
devtools::install_version('bnlearn', version = '4.7')
devtools::install_github("noriakis/CBNplot")
and skip any package updates that are offered, I can install the package without difficulties.

Related

Errors when trying to install 'semPlot' R package

I'm trying to install the package 'semPlot' in RStudio, and keep getting errors:
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rockchalk' in library.dynam(lib, package, package.lib):
DLL 'zip' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Documents/R/win-library/4.0/rockchalk'
Warning in install.packages :
installation of package ‘rockchalk’ had non-zero exit status
ERROR: failed to lock directory 'C:/Documents/R/win-library/4.0' for modifying
Try removing 'C:/Documents/R/win-library/4.0/00LOCK-OpenMx'
Warning in install.packages :
installation of package ‘OpenMx’ had non-zero exit status
ERROR: dependencies 'rockchalk', 'OpenMx' are not available for package 'semPlot'
* removing 'C:/Documents/R/win-library/4.0/semPlot'
Warning in install.packages :
installation of package ‘semPlot’ had non-zero exit status
The downloaded source packages are in
‘C:\AppData\Local\Temp\RtmpE9qK0s\downloaded_packages’
I already installed the package ‘rockchalk’, but it didn't help.
The first time I tried to install 'semPlot' there was an almost endless process which also ended with an error.
You could use the install_github function to install R packages hosted on GitHub from the devtools package. Here is a reproducible example:
devtools::install_github('SachaEpskamp/semPlot')
library(semPlot)
Created on 2022-11-14 with reprex v2.0.2
I solved it by uninstalling R and RStudio, and then installing them, and googling a small problem that came up with tydiverse.

Cannot install vroom under R.4.0.5 on HPC node

To install another package that depends on vroom (which failed) on a HPC node, I sought to install vroom manually.
I tried to install the package manually but it fails too:
My code:
install.packages("vroom")
error message:
installing to /home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘vroom’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so':
/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so: undefined symbol: __cxa_init_primary_exception
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/vroom’
Warning in install.packages :
installation of package ‘vroom’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpgPcp9Y/downloaded_packages’
I have tried under different R versions (3.5.3 up to 4.1.1) but keep having the same issue no matter what version I chose.
I have also deleted any 00LOCK-"package-name" folder that might have arisen in the process in the corresponding R Version package folder, but to no avail.
Can anybody help me out here?
Many thanks in advance,
Philibertus88

How do I download Spectre in RStudio

I am following directions from https://wiki.centenary.org.au/display/SPECTRE/Install+Spectre+from+Github. I do not know RStudio very well, but I need to work with some data and thus need Spectre. For some reason when I put the requisite code it does not work.
Code:
if(!require('devtools')) {install.packages('devtools')}
library('devtools')
install_github("immunedynamics/spectre")
Output (A lot of nonsense followed by):
installing source package ‘Spectre’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in library("flowCore") : there is no package called ‘flowCore’
Error: unable to load R code in package ‘Spectre’
Execution halted
ERROR: lazy loading failed for package ‘Spectre’
removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Spectre’
Warning messages:
1: In i.p(...) : installation of package ‘xfun’ had non-zero exit status
2: In i.p(...) :
installation of package ‘openxlsx’ had non-zero exit status
3: In i.p(...) :
installation of package ‘/var/folders/j7/p3sjp16n6j5c0mk2l4vmn8sw0000gn/T//Rtmpg2qaiD/file185f75fc78b44/Spectre_0.5.0.tar.gz’ had non-zero exit status
Spectre::package.check()
Error in loadNamespace(x) : there is no package called ‘Spectre’
Sorry you had issues during installation. We've made a few updates that should solve this particular problem (which will be present in v0.5.2 and above). Try installing again using the same instructions. I.e.:
if(!require('devtools')) {install.packages('devtools')}
devtools::install_github("immunedynamics/spectre")
You can also post an issue here if you run into any more trouble.
Good luck!
Tom

Issues installing data.table in R 3.6.3 (Oct 2020)

I'm using a Mac with OS Sierra 10.12.5. I'm having trouble with installing the R package "data.table," including if I try to install via install.packages("Hmisc"), or install.packages("data.table"). Both result in:
installing to /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-data.table/00new/data.table/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘data.table’ in library.dynam(lib, package, package.lib):
shared object ‘datatable.so’ not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/data.table’
The downloaded source packages are in
‘/private/var/folders/bl/lgd7_j2j087f24tcly84xg580000gn/T/RtmpbM5EaD/downloaded_packages’
Warning message:
In install.packages("data.table") :
installation of package ‘data.table’ had non-zero exit status
I then tried installing directly from the .zip at: https://github.com/Rdatatable/data.table, but got the following "not available for R 3.6.3" message:
> install.packages("~/Downloads/data.table-master.zip")
Warning message:
package ‘~/Downloads/data.table-master.zip’ is not available (for R version 3.6.3)
I tried the approaches in this thread, but none worked :\ : Problems installing data.table for R
Any advice for what I can try next, or where I can access a version of data.table specifically for R 3.6.3?

XMLSchema 0.8.0 Error in R 3.2.0 on Windows

I'm trying to install the development version (v. 0.8.0) of XMLSchema in R 3.2.0 on a Windows 64-bit computer.
Unfortunately, the release version (v. 0.7.0) doesn't work for the database I am trying to access.
However, when I try to install 0.8.0 from source, I get the following error:
> install.packages("XMLSchema", type="source", repos = NULL)
Installing package into ‘C:/Users/Will/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
* installing *source* package 'XMLSchema' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in .mergeMethodsTable(generic, mtable, tt, attach) :
trying to get slot "defined" from an object of a basic class ("list") with no slots
Error: loading failed
Execution halted
ERROR: loading failed
* removing 'C:/Users/Will/Documents/R/win-library/3.2/XMLSchema'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\Will\Documents\R\win-library\3.2" "XMLSchema"' had status 1
Warning in install.packages :
installation of package ‘XMLSchema’ had non-zero exit status
Any thoughts or insight would be greatly appreciated.
The package worked for previous versions of R, perhaps it's a compatibility problem?
Thanks.

Resources