Problems with XLConnect library - Windows 64 bit - r

I just started with Rstudio programming and I have some issues with XLConnect.
I was able to install "XLConnect" package, then tried to load the "XLConnect" library and got an error as below.
library(XLConnect)
ERROR: package or namespace load failed for'XLconnect':
.onload failed in loadNamespace() for XLConnect, details:
Call. System2("cat",c("/etc/*-release"), stdout =TRUE, stderr = TRUE) error: ' "cat" not found.
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=Italian_Switzerland.1252 LC_CTYPE=Italian_Switzerland.1252 LC_MONETARY=Italian_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=Italian_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0 rJava_1.0-4
Any help would be really appreciated!
Thanks

This is a bug in XLConnect 1.0.3, where it requires cat to be installed on Windows. We fixed it in 1.0.4, so upgrading is the easiest way to fix the problem.
If for some reason you can't upgrade, you may try to install cat on Windows, e.g. using MINGW-w64.
See https://github.com/miraisolutions/xlconnect/issues/132 for the discussion.

Related

Can't solve package or namespace load failed for R ‘later’

I am using Rstudio to load the package "later" running into the following error:
library(later)
Fehler: package or namespace load failed for ‘later’:
.onLoad in loadNamespace() für 'later' fehlgeschlagen, Details:
Aufruf: createCallbackRegistry(id, parent_id)
Fehler: Can't create event loop 0 because it already exists.
Loading the package using the RGUI works fine. Any suggestions what is causing the problem?
Furthermore, loading the package seems to work when I wait a couple of minutes after opening Rstudio.
I do not understand what kind of event loop might already exist.
It might be noteworthy that this problem seem to occur, when I work remote.
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] later_1.3.0
You get the message you saw if you try to run the later:::.onLoad function twice. That shouldn't happen normally, but it might happen if you load it, unload it, and load it again.
Given your comment that it works if you wait a couple of minutes, I'd guess that RStudio is loading it then unloading it, but there's some delay in the full unloading. I don't know if there's any way to affect this.

R M1 builds will not compile packages

I have recently installed the arm64 version of R from the Mac nightly builds page. It's working great! Except - for packages that require compilation. For example, if I try and install xfun which is required for blogdown, I get the following error
ld: warning: ignoring file /usr/local/opt/llvm/lib/libc++.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: in '/usr/local/opt/llvm/lib/libunwind.dylib', building for macOS-arm64 but attempting to link with file built for macOS-x86_64
So..... how to fix this in order to keep things trucking?
For reference, here is my sessionInfo()
> sessionInfo()
R version 4.1.0 alpha (2021-04-26 r80229)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.2.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0 parallel_4.1.0
OK. This was due to setting some MAKEVARS from an older R installation.
I feel ashamed.
But, if anyone else is having this problem, look at ~/.R/Makevars
Now to solve gfortran issues.

how to fix the error: Error in importIntoEnv(pkgenv, exports, nsenv, exports),cannot add bindings to a locked environment devtools-roxygen2?

After updating Rstudio and macOS, my package is no more loadable with devtools:
devtools::load_all(".")
Loading mgwrsar
Error in importIntoEnv(pkgenv, exports, nsenv, exports) :
cannot add bindings to a locked environment
I update the following packages: devtools, roxygen2 and rstudioapi, but it doesn't resolve this issue
I try to switch to hadley devtools version : install_github("hadley/devtools")
same issue.
My session info :
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4 yaml_2.1.19
You can also get this error from calling library(package) from within the package itself.
Duckmayr's response helped me solve my issue for this same problem:
Do you assign anything to the global environment in your package?
I had saved a new R script in my package project as mypackage/R/myscript.R instead of mypackage/separate_testing_folder/myscript.R. Of course, nothing but actual code pertaining to definition of functions etc should be saved in any scripts within the R/ directory.
In my case, I was accidentally referencing the name of my package INSIDE of my DESCRIPTION. Woops, something like this - I fixed it like so.
Package: utilities
Depends:
dplyr, # and comma here
utilities # remove this

I can't load devtools in R 3.2.0

I am developping R packages with Rstudio. Until now, I used R 3.1.2 and all worked fine. Recently I have updated R to 3.2.0 version and I have updated the packages too. Now, when loading devtools:
> library(devtools)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Documents and Settings/cruiz.CREAL/Mis documentos/R/win-library/3.2/git2r/libs/i386/git2r.dll':
LoadLibrary failure: No se encontró el proceso especificado.
Error: package or namespace load failed for ‘devtools’
I have reinstalled devtools and git2r with biocLite and with install.packages and it didn't work. This file already exists and it is on this path.
My R session Info:
R version 3.2.0 (2015-04-16)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows XP (build 2600) Service Pack 3
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.2.0
Thank you very much!
I suggest the following:
remove.packages(c("git2r", "devtools", "rversions")).
Use the information from my answer on this post -- R - Error installing Devtools in Windows to reinstall devtools. This should also reinstall the needed dependencies.

Access data base import to R-installation of mdb tools on Mac

The plan ist to import an Access database into R to filter out what I need to make statistical analysis.
A colleague suggested me the following code:
library(Hmisc)
d <- mdb.get('140410_db_vegBY1.mdb')
#(data under #https://www.dropbox.com/sh/ra588lailweynrq/AACRVqMKWtd9Zz7fa94O9CAUa)
# ERROR: sh: mdb-tables: command not found
# Fehler in system(paste("mdb-tables -1", file), intern = TRUE) :
# Fehler bei der Ausführung des Kommandos
After my search I started to install mdb tools on my mac OS X 10.9.2 following this link:
http://automatthew.wordpress.com/2008/06/23/how-to-compile-mdbtools-on-mac-os-x-10-4-and-10-5/#comment-124
But it didn't work but the thread seems to be inactive.
Can somebody help me?
The following steps worked for me.
Install the Hmisc package for R.
Install mdbtools version 0.7.1 by homebrew: brew install mdbtools.
Use mdb.get() function in the Hmisc package to read .mdb files into R:
library(Hmisc)
df <- mdb.get('file.mdb')
Here is my setup and package versions:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.1 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] Hmisc_3.17-0 ggplot2_1.0.1 Formula_1.2-1 survival_2.38-3
[5] lattice_0.20-33
I should mention that I first tried to install mdbtools from source to no avail. I suspect that it was because some dependencies were not installed. See https://github.com/brianb/mdbtools for more information on the dependencies.

Resources