Error in rbind(info, getNamespaceInfo(env, "S3methods")) when installing factoextra - r

I'm trying to install the "factoextra" package using a local source tar ball on Windows. I can install other packages in the same way with no problem. However, when installing "factoextra", I get an error relating to S3methods.
I have tried using local windows binaries, installing the latest Rtools and made sure I have all the dependencies installed. I have also tried to use archived versions of the package.
install.packages('D:\\R_Packages\\Packages\\factoextra_1.0.5.tar.gz', repos = NULL, type="source")
* installing *source* package 'factoextra' ...
** package 'factoextra' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
number of columns of matrices must match (see arg 2)
ERROR: lazy loading failed for package 'factoextra'
* removing 'D:/R-3.5.2/library/factoextra'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘D:/R_Packages/Packages/factoextra_1.0.5.tar.gz’ had non-zero exit status
I really just need this package to install.

I found this thread: http://r.789695.n4.nabble.com/Error-in-rbind-info-getNamespaceInfo-env-quot-S3methods-quot-td4755490.html, which leads me to how I solved a similar issue on my machine.
I found that a broken version of the package was installed on my system and had to be removed manually before I could install a clean version.
Find if and where factoextra is installed (it might be on your system, just outdated or broken):
find.package("factoextra")
If it's there already (just broken), you can try to remove it with:
remove.packages("factoextra")
If remove.packages() fails even though find.packages() says the package is there, use the path returned by find.packages() to use your OS' file system to find and delete the package - just be careful only to delete stuff you know is broken.
Once the old, broken package is removed, use install.packages("factoextra") and it should work.
I had several packages that were broken in this way. If that's the case for you, you can identify which packages to remove and install this way by using something like:
allPackages <- installed.packages()[, 1]
findBrokenPackages <- function(packages) {
for (p in packages) {
tryCatch(ncol(asNamespace(p)$.__NAMESPACE__.$S3methods),
error = function(e) print(c(p, e)))
}
}
findBrokenPackages(allPackages)
This will print out any packages that have the same issue. I would suggest removing all broken packages before trying to use install.packages() again.

Related

R install package tabplot

When I install R package, tabplot, below message has come.
My R version has updated 4.0.4 because 4.0.2 had same error.
error message is below)
Warning in install.packages :
package ‘tabplot’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Could you pls share how to resolve this issue?
Let's go meta for a moment:
What are you trying to do? Do you have a particular function in that archived package that you are hoping to apply to your dataset? ( which would imply that we needed to know which function. ... and a bunch of other questions.)
Or is this an effort to follow a blog or tutorial from the Web? (Again which one?)
I see this when I execute:
> install.packages("tabplot")
Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘tabplot’ is not available (for R version 3.6.3)
So at this point my guess is that the tabplot maintainer has not keep pace with the evolution of R. Because ... packages that depend on the syntax or the behavior of core R functions or the CRAN rules that might change over time depending on the considered decisions of the R Core and CRAN. That's just the way it is. There's a further sort of language/system evolution that Hadley spawned.(ggplot and magrittr/ddplyr/rlang). (Arguably the S4 tributary is in the same category. The last CRAN-accepted version was downloadable from: <search-for exact URL> at 'an URL to be named later"' produces "Archived on 2020-02-19 as check problems were not corrected despite reminders." So that's pretty recent. Perhaps we can just download a copy of the most recent "tabplot-xx.xx.xx.xx.tar.gz" file from the CRAN archive and install from local source. (Note: need to use repo=NULL in the install.packages call.)
Well, that's not working yet because of an unmet dependency on an object named clone from package:ff.
install.packages("~/Downloads/tabplot/", repos =NULL)
#--------------
Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘tabplot’ ...
** package ‘tabplot’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘clone’ is not exported by 'namespace:ff'
Execution halted
ERROR: lazy loading failed for package ‘tabplot’
* removing ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1/tabplot’
So perhaps you can live with some drop-in R code from the expanded source on the CRAN Archive?
EDIT: So I tried figuring out how to handle that sort of error and finally decided to try changing the NAMESPACE file. It's a text file that names various functions and where the program should find them. The two lines I needed to change were the ones importing ff:::clone and ff:::is.factor.ff so change them to
importFrom(bit, clone) # the bit package has an exported version
importFrom(ff, is.factor) # removed the `.ff` from its name
And now I get:
install.packages("~/Downloads/tabplot/", repos =NULL)
Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘tabplot’ ...
file ‘NAMESPACE’ has the wrong MD5 checksum
** using staged installation
** R
** demo
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (tabplot)
The warning message is because I edited the NAMESPACE file but didn't do a full rebuild. Also note that you will not need the Rtools on a Windoze machine or the XCode and CLT on a Mac because there is no compiled code in this package.
It does appear that most of my efforts are paralleling the changes being made to the github version. See https://github.com/mtennekes/tabplot/issues/21 where the is.factor.ff issue was addressed 2 days ago. The author/maintainer says the package will be resubmitted to CRAN.
Despite claims that resubmission will occur. there does not seem to be any progress on that front. https://cran-archive.r-project.org/web/checks/2020/2020-02-19_check_results_tabplot.html However the github page suggests an installation via devtools and that succeeds for version 1.4.1 on an Ubuntu machine, despite the reports of errors in the earlier version that had been submitted to CRAN.

Error installing packages using renv::restore()

I have a problem using renv. For a larger project we want to use renv to all have the same version of r and all our packages. Yet, as soon as a newer version of a package is available and we run renv::restore() we get an error like the following (please note: rcpparmadillo is not the only package. It also happens with greybox, mime, stringi and many more).
Error installing package 'RcppArmadillo':
=========================================
* installing *source* package 'RcppArmadillo' ...
** Package 'RcppArmadillo' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
Warning in system(paste(cmd, "shlib-clean")) 'make' not found
Warning in system(cmd) 'make' not found
ERROR: compilation failed for package 'RcppArmadillo'
* removing 'C:/Users/..../renv/staging/1/RcppArmadillo'
Error: install of package 'RcppArmadillo' failed
I now have two questions:
How can I fix this error?
How can we use the same versions of packages throughout our team if renv crashes everytime a newer version is available?
Thank you.
Lizzie
The ultimate issue here is that renv is trying to install these packages from sources, as binaries for these older packages are no longer available from CRAN. There are two potential solutions to this issue:
Consider using a MRAN checkpoint as your R repository. The plus side is that binaries for these older packages will remain available; the downside is that you won't be informed if newer packages do become available.
Install the requisite software so you can build these packages from sources.
For 2. on Windows, you will need to install Rtools:
https://cran.r-project.org/bin/windows/Rtools/
You can also use the renv::equip() function to download a variety of libraries needed to compile some packages from sources (for example, nloptr).

R ggbiplot installation errer

I know this is a recurrent issue. However, going through all the hits when I google still has not helped me solve the issue. I hope someone can help: Her is what I do:
1: I run
install.packages('devtools')
library(devtools)
This appears to run all right. At least I do not get any error messages.
2: then I do:
install_github('vqv/ggbiplot', force=TRUE)
Then the errors messages comes:
install_github('vqv/ggbiplot', force=TRUE)
Downloading GitHub repo vqv/ggbiplot#master
√ checking for file 'C:\Users\jada\AppData\Local\Temp\RtmpgvAEpK\remotes28461c455b1\vqv-ggbiplot-7325e88/DESCRIPTION' ...
- preparing 'ggbiplot':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'ggbiplot_0.55.tar.gz'
Installing package into ‘C:/Users/jada/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing source package 'ggbiplot' ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package 'ggplot2' was built under R version 3.6.1
Execution halted
ERROR: lazy loading failed for package 'ggbiplot'
* removing 'C:/Users/jada/Documents/R/win-library/3.6/ggbiplot'
Error: Failed to install 'ggbiplot' from GitHub:
(converted from warning) installation of package ‘C:/Users/jada/AppData/Local/Temp/RtmpgvAEpK/file28421d56f74/ggbiplot_0.55.tar.gz’ had non-zero exit status
If anyone could sort me out here, I would be very happy.
Thank you.
jd
I suggest you to go in the path of the library in your computer (should be c:/Users/jada/Documents/R/win-library/3.6/) and delete the ggbiplot folder. After this, redo the installation process.
In this way you remove every possible problem conflict.
If this doesn't work out try also to delete ggbiplot_0.55.tar.gz in the Temp folder as suggested in the error.
I know it is an old question, but I have found a solution in here, and just in case the link does not work, here is the possible solution:
install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

Unable to install new R packages in DSX Desktop

I've just installed DSX Desktop with RStudio. I'm unable to load new packages, e.g. lubridate, and get the error below. If I check for package updates, I get the message "all packages are up-to-date", but the error below suggests it needs a newer version of Rcpp.
installing to /user-home/_global_/R/lubridate/libs
** 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]]) :
namespace ‘Rcpp’ 0.12.9.2 is already loaded, but >= 0.12.13 is required
ERROR: lazy loading failed for package ‘lubridate’
* removing ‘/user-home/_global_/R/lubridate’
Warning in install.packages :
installation of package ‘lubridate’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpIV4HWl/downloaded_packages’
I tried install.packages("Rcpp") which returned the message:
Error in unloadNamespace(pkg_name) :
namespace ‘Rcpp’ is imported by ‘httpuv’, ‘reshape2’, ‘tidyr’, ‘bindrcpp’, ‘tibble’, ‘htmltools’, ‘dplyr’, ‘plyr’ so cannot be unloaded
If I try remove.packages("Rcpp") or removing the packages above, I get the following message, and they remain in the Packages view.
Removing package from ‘/user-home/_global_/R’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘Rcpp’
Any advice please on how to proceed?
There seems to be a fundamental problem with RStudio. I encountered exactly the same problems you describe with the latest version (1.1.442). The problems are:
Packages viewed as out-of-date go into a loop when installing with a repeated error dialog box appearing.
The package version check refers out-of-date packages and will not install the current package versions showing on CRAN. This is due to RStudio pointing at a MRAN mirror that has old updates. This means that all packages stored there are out of date. You can see when the packages on MRAN were last updated here.
Removal of other packages (e.g. dependencies) doesn't work properly, and manual deletion of the folders doesn't solve the problem.
Inside Tools, Global options, Packages there is the ability to specify the mirror that should be used for package management. This doesn't seem to work.
I fixed my problem by going into R and performing a package update inside that. RStudio now uses the updated packages.
I have contacted RStudio about this and received the reply that they don't provide support for free versions of RStudio.
tl;dr: RStudio appears to be broken for updating packages. Use R itself for updates.
I was getting this error:
Windows 7, update.packages problem: “unable to move temporary installation”? Which I think was due to my antivirus, but not sure. MRAN version was 3.3.1 and this is what I would do to fix this error everytime I opened R-Studio and needed to install:
trace(utils:::unpackPkgZip, edit=TRUE)
# Edit line 142 - change Sys.sleep(2.5)
I was still having versioning issues with tidyverse, so looked around and decided to install the latest MRAN from Microsoft and that fixed all of my R-Studio versioning issues and install inssues. I had other issues where I was doing a work.
Version info:
Microsoft R Open 3.5.1
The enhanced R distribution from Microsoft
Default CRAN mirror snapshot taken on 2018-08-01.
Download Microsoft R Open 3.5.1

Installing xml2 in R in Fedora 27

I'm having trouble installing xml2 in RStudio, running Fedora 27. On running install.packages('xml2'), I get the following error:
installing to /home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2/libs
** R
** inst
** preparing package for lazy loading
** help
Error : /tmp/Rtmp2sKZQZ/R.INSTALL689b37bd918d/xml2/man/read_xml.Rd:47: unable to load shared object '/home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2/libs/xml2.so':
libicui18n.so.58: cannot open shared object file: No such file or directory
ERROR: installing Rd objects failed for package ‘xml2’
* removing ‘/home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpPs5Gzi/downloaded_packages’
I noticed in my /usr/lib64/, I have libicui18n.so.57 only, so I tried copying a libicui18n.so.58 there, and I got the following error:
installing to /home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2/libs
** R
** inst
** preparing package for lazy loading
** help
Error : /tmp/Rtmp908Ecf/R.INSTALL653812e0e41f/xml2/man/read_xml.Rd:47: unable to load shared object '/home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2/libs/xml2.so':
libicuuc.so.58: cannot open shared object file: No such file or directory
ERROR: installing Rd objects failed for package ‘xml2’
* removing ‘/home/ryi/R/x86_64-redhat-linux-gnu-library/3.4/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpPs5Gzi/downloaded_packages’
And I noticed the same problem -- I have version .57, not version .58 of this library as well. Before I repeat this over and over, is this in fact a shared library problem? Or, is there a way to fix this all at once?
I have xml2 installed (libxml2-devel-2.9.5-2.fc27.x86_64) already.
Since no one answered this yet and I've found a hacky solution, I thought I'd give an update on what worked.
It appears that my issue was that, even upon installing libxml2-devel, the version of the libraries I had in /usr/lib64 were not the same version required by RStudio's xml2 package. For example, regarding the particular package being mentioned in my question above, libicuuc.so.58, only libicuuc.so.57 could be found in /usr/lib64.
Running locate libicuuc.so.58, I found that anaconda3 has the correct versions of the libraries, so I got around the above problem temporarily by simply adding ~/anaconda3/lib to $LD_LIBRARY_PATH, roughly following instructions here.
This is a bit hacky, but led to successful installation.
Edit (IMPORTANT): Adding ~/anaconda3/lib to LD_LIBRARY_PATH in .bashrc caused a login loop, presumably because Fedora was trying to use the wrong libraries. To fix this, I added the lines:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ryi/anaconda3/lib/
export LD_LIBRARY_PATH
to R_HOME/etc/ldpaths.
I have solved this problem by install the ICU4C by source:
downloading ICU4C 58.2 from: ICU-Project
compiled
added the library location to $LD_LIBRARY_PATH,
the install will be work.

Resources