Unix-only package error in R - r

I'm trying to build the R package bigmemory for Windows 8 x64. However, when running R CMD INSTALL --build bigmemory_4.4.3.tar.gz, I receive the error ERROR: Unix-only package. I do not know why this is happening, but my guess is that it has something to do with the configure file of the package. I'm using R 3.0.1, 64 bit.

See this link, Windows support has been suspended. It's not your R-version, if you want to make use of it you'll have to use cygwin or install a Linux partition. You can also try the package ff.

The bigmemory NEWS, says "Windows support is temporarily suspended due to issues with the Boost headers." for the most current version of bigmemory.
The package you mention in the comments doesn't depend on a specific version of bigmemory, so you could try to build one of the older versions of bigmemory from the archive.

Related

Exporting excel files from R in windows [duplicate]

I am trying to load the rJava using the command:
library(rJava)
But I get the following error:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package or namespace load failed for ‘rJava’
I tried reinstalling both the Java and the R program with the latest versions
but still get these errors..
May I know how I can resolve this? Thank you very much!
This error is often resolved by installing a Java version (i.e. 64-bit Java or 32-bit Java) that fits to the type of R version that you are using (i.e. 64-bit R or 32-bit R). This problem can easily effect Windows 7 users, since they might have installed a version of Java that is different than the version of R they are using.
http://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/
Install 64 bit Java from https://java.com/en/download/manual.jsp.
Then in windows cmd run
setx PATH "C:\Program Files\Java\jre1.8.0_211\bin\server;%PATH%"
(make sure your path is correct).
Then in RStudio run
Sys.setenv(JAVA_HOME="")
Now, you should be able to run rJava!!
I got the same error resolved by installing same version of R and Java i.e. 64 bits and manually updating the path i.e. ,
Sys.setenv(JAVA_HOME='C:/Program Files/Java/jre1.8.0_121') # for 64-bit version
R for Windows installer installs by default both 32-bit and 64-bit files. Reinstalling R and unticking 32-bit part solved the problem for me.
Under Windows 10, first check your (running) R-Version:
R.version
If you see something like x86_64, a 64-bit version of Java is needed.
Simply downloading and installing the matching Java version (https://java.com/en/download/manual.jsp) solved the problem for me. No reinstall of R needed (as suggested by other users here). There also was no need to set the path explicitly.
As mentioned in the r-statistics link cited above, you have to manually download the 64-bit version of Java. If not, then the 32-bit version will be installed.
So, if you have a 64-bit operating system, then ensure that both R and Java are using the 64-bit installs. Otherwise, this problem will persist.
This has been killing me and I have tried multiple methods above, it doesn't work. After, I mix all solution to try and below process works for me.
Install Java for 64 bit
Run below code in windows command
setx PATH "C:\Program Files\Java\jre1.8.0_171\bin\server;%PATH%"
(please change the address acorrding to your dvm.dll real address)
Run below in R studio
Sys.setenv(JAVA_HOME="")
Then I finally can run
library(rJava)
library(xlsx)
I faced the same issue and was feeling very down as I couldnt get my analysis done.
This worked for me :
check your operating system. 64 bit or 32 bit.
https://helpx.adobe.com/x-productkb/global/determine-whether-computer-running-32.html
uninstall previous versions of Java.
delete rJAVA library from Doc>R>win-library. If you have more than 1 versions of R, make sure you delete rJAVA package from all of them.
install Java based on system requirement (64 bit or 32 bit).
and finally restart R before and after installing rJava package.
If R is 64-bit version make sure to install Java 64-bit version!
If R is x86-bit version make sure to install Java x86-bit version!
You can add INSTALL_opts=c("--no-multiarch") to your install_github() call:
devtools::install_github("mne-tools/mne-r", INSTALL_opts=c("--no-multiarch"))
For more info: https://github.com/mne-tools/mne-r/issues/5#issuecomment-489588267
Create a new directory in C: drive as "library"
set your libPath this directory. you need to type
.libPath("C:/library")
reinstall packages which requires java (xlsx, rJava, RJDemetra)
it will give error message again but it will work.

Can we install a `.zip` R package under linux?

I have found an old R package with a .zip extension on my PC.
I would like to run it, but I do not have the tar.gz that was used to
create it and I use linux. What are my options?
Few, essentially.
A .zip package for R is almost surely a binary built for Windows so you need to find a suitable Windows computer -- or emulator -- to use it.
So, this can be done this way:
install wine (wine is not an emulator),
install R for Windows, which you download manually from CRAN
install the zip package using the usual commands (install.packages("filename.zip",source=NULL)). You will probably get error messages for the dependencies, but incrementally installing those, it should work.

How to install BigMemory and bigrf on windows OS

I have been trying to install bigmemory on my R installation.
My OS is windows 7 64 bit and I have tried it on R V2.15.1,2.15.2 and 3.0.1 64 bit but I cant get it to work.
I have tried several options
download the current source and run the command in R v3.0.1
install.packages("D:/Downloads/bigmemory_4.4.3.tar.gz", repos =
NULL, type="source")
but this gives an error "ERROR: Unix-only
package"
download older sources and run a similar commands, in the various
installations of R V2 V3 etc,
This gives me an error "ERROR:
configuration failed for package 'bigmemory'"
Any ideas? I am actually trying to install bigrf but bigmemory seems to be a dependency. Is there any workaround for this?
Many thanks
Seems the github version installs OK on Windows:
install.packages(c("BH","biglm"))
library(devtools)
devtools::install_github('kaneplusplus/bigmemory')
library(bigmemory)
the package authors told me they are fixing the CRAN one to work on Windows again too.
Going to the CRAN page here, shows you that you have to compile the sources on windows. Google how to do it or look at official document : here
Of course if package A depends on B you have to install B before A yourself.
EDIT: actually it says OS_type : unix

How can I access Windows COM objects in R v3?

Some time ago, you used to be able to install the rcom package in R to use COM scripting (eg, access to external programs.) Unfortunately, it seems to be discontinued:
Package ‘rcom’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
This depends on statconnDCOM, which nowadays restricts use, contrary
to the CRAN policy for a package with a FOSS licence. See
http://rcom.univie.ac.at/ and http://www.statconn.com/.
Following the archive and statconn links and installing one of the older versions in R version 3 gives the error:
“Error: package ‘rcom’ was built before R 3.0.0: please re-install
it”.
I am not very familiar with R, but there seems no way around this message - after all, it occurs when installing, so re-installing doesn't seem to be the answer. It appears as though rcom is simply not available for recent (3.0+) versions of R. I have also scanned the package list, although searching for "COM" there returns over a hundred results and it is possible I missed the right one when clicking through them.
How can I use the rcom package, or use COM from within R some other way?
(Note: I am asking this question on behalf of a colleague. I have no experience with R myself at all. Both of us, when searching for answers, could not find anything. I am sure that others are also using COM in the latest version of R, though!)
I looked at the rcom source code a few months ago. It seems I can get it to build and install OK on R3.0.1. Below is the procedure if it helps.
Get a checkout of the latest source code of rcom. I have rcom_2.2-5.tar.gz locally. I can google something at the following address, but I have no idea of the provenance, so up to you to check it is legit. http://cran.open-source-solution.org/web/packages/rcom/index.html
in R do install.packages('rscproxy')
install Rtools as per the instructions on the R web site (http://cran.r-project.org/bin/windows/Rtools),
open a Windows command prompt i.e. run "CMD"
go to the folder containing the 'rcom' folder, and at the command prompt:
set R="c:\Program Files\R\R-3.0.1\bin\i386\R.exe"
%R% CMD check --no-manual rcom
check it passes without too many complaints. Your call as to the --no-manual option (if you have MiKTeX installed you may remove it)
%R% CMD INSTALL rcom
should result in
installing to c:/Rlib/rcom/libs/i386
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
rcom requires a current version of statconnDCOM installed.
To install statconnDCOM type
installstatconnDCOM()
This will download and install the current version of statconnDCOM
You will need a working Internet connection
because installation needs to download a file.
* DONE (rcom)
in R:
library(rcom)
installstatconnDCOM()
I tried a comRegisterRegistry() ; comRegisterServer()
; x<-comGetObject("Excel.Application") but I get a NULL for x. I am not a user of rcom so while it all seems to compile fine; it may just not work anymore.
If you happen to need to access .NET code, a viable option (and yes I have a vested interest in mentioning it) may be the rClr package.
Hope this helps; I'd be interested to hear how you go.
This really should be a comment, but I don't have enough rep points yet to leave one.
I found that the above steps did not work for me, but the answer posted by Lisa Ann on this question, RExcel in R 3.0.x, did solve my problem installing rcom. Since you need rcom to run RExcel, the initial steps to install RExcel cover installing rcom on newer versions of R (such as 3.0.2).
Specifically, following the advice on statconn's wiki, http://homepage.univie.ac.at/erich.neuwirth/php/rcomwiki/doku.php?id=wiki:how_to_install
You also need to follow these instructions if you upgrade R, i.e. you install a new >release of R after you have installed RExcel.
Download the statconn DCOM server and execute the program you downloaded
Start R as administrator (on Windows 7 you need to right-click the R icon and click the >corresponding item)
In R, run the following commands (you must start R as administrator to do this)
install.packages(c("rscproxy","rcom"),repos="http://rcom.univie.ac.at/download",lib=.Library)
library(rcom)
comRegisterRegistry()
Now you have rcom installed, [instructions for installing RExcel follow...]
New versions of rcom and rscproxy (also for current versions of R) are available from a different repository. Just use http://rcom.univie.ac.at/download as the R repository to install from and you can download and install binary versions of statconn packages from there.
Hope this helps!

Can I use cairoDevice in R under Windows?

Currently, on my R 2.10.1 installation on Windows XP,
capabilities()["cairo"]
returns False. Loading the package cairoDevice fails with the message "LoadLibrary failure" however the shared library "C:/Programme/R/R-2.10.1/library/cairoDevice/libs/cairoDevice.dll" is there. Any ideas how I can make cairo work on windows?
The capabilities refers to the R binary and its compile-time options.
The add-on package could or should still work. You may need to install the Gtk2 libraries this depends upon. This is the same for other packages using RGtk2 such as, say, Rattle. See eg this message by Brian Ripley.

Resources