rjava

Call a java method in R using rJava

和自甴很熟 提交于 2019-12-06 05:49:42
I use rJava to call a java code from R, trying to call an algorithm from SPMF tool. I tried to use a wrapper function as in this question , but this did not work with the SPMF code. this is my R code: library(rJava) .jinit() .jaddClassPath ( "C:/mydrive/eclipse-workspace/myfile/src") print(.jclassPath()) obj <- .jnew("AlgoFPGrowth_Strings") s <- .jcall(obj, returnSig= "V", method="runAlgorithm", "input.csv","output.txt") , 0.4 ) it gives me error ,method runAlgorithm with signature (D)V not found this is the main in java: public static void main(String[] args) throws Exception { AlgoFPGrowth

Cannot Initialize CoreNLP in R

自闭症网瘾萝莉.ら 提交于 2019-12-06 05:25:27
I am unable to access coreNLP in R on a Mac running High Sierra. I am uncertain what the problem is, but it seems that every time I try again to get coreNLP to work, I am faced with a different error. I have JDK 9.0.4. Please see my code below for what I am attempting to do, and the error that stops me. My previous attempt I was able to get initCoreNLP() to run and load some elements of the packages, but it would fail on others. When I then attempted to run annotateString() , it would throw the error Error Must initialize with 'int CoreNLP'! . I have downloaded and re-downloaded the coreNLP

rJava installation fails on macOS 10.14

十年热恋 提交于 2019-12-06 04:12:48
After upgrading to MacOS Mojave (10.14.1), I'm no longer able to install rJava for R version 3.5.1 with Java version "1.8.0_102" installed. I tried the previous solution for MacOS 10.11 but it still did not work, giving this error: Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6

Problems requiring rJava in Windows

早过忘川 提交于 2019-12-05 16:40:25
问题 I am using a 64-bit machine, with the latest version of R (3.1.2), the latest RStudio version (0.98.1091) and the latest JAVA (Version 8 Update 31). I tried to require rJava (rJava_0.9-6) and the result is the following error: require(xlsx) Carregando pacotes exigidos: rJava Error : .onLoad falhou em loadNamespace() para 'rJava', detalhes: chamada: fun(libname, pkgname) erro: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching

install rJava - One or more JNI types differ from the corresponding native type on Mac Os 10.11

南楼画角 提交于 2019-12-05 12:00:02
I am trying to get a working R environnement on my mac. I just updated to Mac OS 10.11.1. From rStudio, install.packages("rJava") leads to this error: checking Java support in R... present: interpreter : '/usr/bin/java' archiver : '/usr/bin/jar' compiler : '/usr/bin/javac' header prep.: '/usr/bin/javah' cpp flags : '-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin' java libs : '-L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server -ljvm' checking

Issues using xlsx package to insert data from R to excel

烈酒焚心 提交于 2019-12-05 10:21:40
I´m trying to create a new excel workbook from R to save a few small datasets using xlsx package. For some reason it was working fine, but i´m unable to do it again. Code to create a new workbook library("xlsx") library("xlsxjars") library("rJava") file <- "marca_imei.xlsx" wb <- loadWorkbook(file) # The error: # Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : # java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream I´ve searched for an answer but it seems people are having the same error when importing data from excel. I

Unloading rJava and/or restarting JVM

可紊 提交于 2019-12-04 18:41:51
问题 I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each child process, e.g: library(rJava) library(parallel) myfile <- system.file("tests", "test_import.xlsx", package = "xlsx") #This works: mccollect(mcparallel({ #Automatically initiates JVM in child xlsx::read.xlsx(myfile, 1) })) However the problem in my case is that the JVM has already been initiated in the (main) parent process as

Problems requiring rJava in Windows

℡╲_俬逩灬. 提交于 2019-12-04 01:39:09
I am using a 64-bit machine, with the latest version of R (3.1.2), the latest RStudio version (0.98.1091) and the latest JAVA (Version 8 Update 31). I tried to require rJava (rJava_0.9-6) and the result is the following error: require(xlsx) Carregando pacotes exigidos: rJava Error : .onLoad falhou em loadNamespace() para 'rJava', detalhes: chamada: fun(libname, pkgname) erro: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Failed with error: ‘package ‘rJava’ could not be loaded’ I already tried to re-install

Can't install rJava 0.9 on Ubuntu 10.04

痞子三分冷 提交于 2019-12-03 23:19:16
I use R 2.13 from the CRAN apt repo for Ubuntu 10.04, and I'm trying to install Deducer, which requires JGR/rJava, but rJava refuses to build/install, complaining about being unable to build a JNI app. I tried sudo R CMD javareconf as suggested but that only led to a different error about the configuration being unset. I found R: rJava package install failing , so I tried the suggestions there of installing r-cran-rjava (but that's 0.8 and Deducer/JGR seem to insist on installing 0.9) and fiddling with my $JAVA_HOME , all to no avail. Any ideas? Here's a more complete transcript of what

Installation of rJava

前提是你 提交于 2019-12-03 18:49:39
问题 I've tried to solve this using the previous questions/answers on SO but without any success. So, here's my problem. I'm using RStudio on and Ubuntu box (14.04) and I tried to upgrade rJava from sources and in the process I managed to lose it. I tried to install it again using, install.packages("rJava") which returned the following error message, configure: error: One or more Java configuration variables are not set. Make sure R is configured with full Java support (including JDK). Run R CMD