[R] R maintains old values
Hello, I have a strange side-effect from executing R-scripts using R and RServe. I am executing an R-Script from a Java file using RServe in R. I also have RStudio installed, but it's not running at the time. The R-script reads a CSV file and does various statistical things. RServe enables me to run each line of the R script using "eval()" line by line. All this works fine for a correctly-formatted CSV file. It's great. But, if the CSV file isn't correctly formatted, AND the last CSV file did correctly get run, then, with the incorrect CSV as input, the output is what ran last time. Somehow, the last correct run is persisted and returned if there is some problem with the current CSV input. This data persistence is maintained across reboots. I'm thus baffled how R is maintaining these old values, but more to the point, I need to know how to clear these old values so if the CSV input is incorrect, I get nothing back, not the old CSV values from a correctly formatted file. Hope this description is clear. Thanks in advance to all. - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Where to get support for Rserve?
Hey Bert, That's super helpful (maintainer ("rserve")). I had no idea. :) So much good stuff right there in R. I didn't find any relevant hits looking on the web for my particular problem, but I'll email the maintainer. Thanks very much. - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. > Original Message > Subject: Re: [R] Where to get support for Rserve? > Local Time: November 13, 2017 11:34 AM > UTC Time: November 13, 2017 4:34 PM > From: bgunter.4...@gmail.com > To: Morkus <mor...@protonmail.com> > r-help@r-project.org <r-help@r-project.org> > > ?maintainer > ## i.e. > > maintainer("rserve") > > Also, please search. A web search on simply "rserve" brought up what appeared > to be many relevant hits. > > Cheers, > Bert > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > On Mon, Nov 13, 2017 at 4:48 AM, Morkus via R-help <r-help@r-project.org> > wrote: > >> Hello, >> >> I'm using Rserve with Java and although it works OK for 50 or 60 requests, >> eventually Rserve simply stops responding and I have to force-quit and >> restart Rserve. During this time the JVM is fine and Tomcat (app server) is >> fine, too. >> >> The basic Java code does this: >> >> 1. Create an R Connection >> 2. Execute an R Script via Rserve "eval" statements >> 3. Close the R Connection. >> >> I was going to use a memory profiler to see what was going on but Tomcat is >> not showing any Java-code memory leaks. >> >> Looking at the Rserve page, I see everything about the Rseve author...except >> for a way to contact him (unless I somehow missed that.) >> >> This may not be the correct R forum to ask this question, but I need to >> start somewhere. >> >> *** Note, in the past I've posted messages like this to the R developer >> forum only to be told that that programming forum is not the right forum as >> it's only for "pure" R programming *** >> >> Would appreciate any suggestions. >> >> Thanks, >> >> - M >> >> Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Where to get support for Rserve?
Hello, I'm using Rserve with Java and although it works OK for 50 or 60 requests, eventually Rserve simply stops responding and I have to force-quit and restart Rserve. During this time the JVM is fine and Tomcat (app server) is fine, too. The basic Java code does this: 1. Create an R Connection 2. Execute an R Script via Rserve "eval" statements 3. Close the R Connection. I was going to use a memory profiler to see what was going on but Tomcat is not showing any Java-code memory leaks. Looking at the Rserve page, I see everything about the Rseve author...except for a way to contact him (unless I somehow missed that.) This may not be the correct R forum to ask this question, but I need to start somewhere. *** Note, in the past I've posted messages like this to the R developer forum only to be told that that programming forum is not the right forum as it's only for "pure" R programming *** Would appreciate any suggestions. Thanks, - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Pass Parameters to RScript?
Thanks Eric, I saw that page, too, but it states: "This post describes how to pass external arguments to R when calling a Rscript with a command line." Not what I'm trying to do. Thanks for your reply. Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. > Original Message > Subject: Re: [R] Pass Parameters to RScript? > Local Time: October 30, 2017 9:39 AM > UTC Time: October 30, 2017 1:39 PM > From: ericjber...@gmail.com > To: Morkus <mor...@protonmail.com> > r-help@r-project.org <r-help@r-project.org> > > I did a simple search and got hits immediately, e.g. > https://www.r-bloggers.com/passing-arguments-to-an-r-script-from-command-lines/ > > On Mon, Oct 30, 2017 at 2:30 PM, Morkus via R-help <r-help@r-project.org> > wrote: > >> Is it possible to pass parameters to an R Script, say, from Java or other >> language? >> >> I did some searches, but came up blank. >> >> Thanks very much in advance, >> >> Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Pass Parameters to RScript?
Is it possible to pass parameters to an R Script, say, from Java or other language? I did some searches, but came up blank. Thanks very much in advance, Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Creating a data table (frame?) from a SQL Statement?
Hello, I'm new to R so this is probably a simple question for somebody. I have an RScript that reads a CSV on the disk using read.table(...). It then does a boxM test using that data. However, I'm now trying to load the same data via an SQL command, but I can't seem to get the data structure defined so R will like it -- using the included "iris" dataset. I've tried these ways of loading the SQL statement into a compatible R Structure: irisQuery <- data(dbGetQuery(conn, "select * from iris")) irisQuery <- data.frame(dbGetQuery(conn, "select * from iris")) irisQuery <- table(dbGetQuery(conn, "select * from iris")) . . . Followed by: boxM(irisQuery[,-5], irisQuery[,5]) Nothing works work. For example, if i use ... irisQuery <- data.frame(dbGetQuery(conn, "select * from iris")) I get this error from R on the boxM test: Error: is.numeric(x) || is.logical(x) is not TRUE The SQL Statement is returning results, but their not CSV. Not sure if that matters. --- So, how do I read a SQL statement into an R structure like I read the CSV using "read.table" so the boxM test will work? Thanks very much in advance. - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problem when trying to run Java in R:
Hello All, Although running Java from R used to work, for some mysterious reason, it's stopped. Today when I tried to load a basic JDBC driver (or the sample .jinit()) code, I got: - JavaVM: requested Java version ((null)) not available. Using Java at "" instead. - JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib - JavaVM FATAL: Failed to load the jvm library. I saw postings on StackOverflow about this issue, but none of the suggested fixes helped. I'm on Mac OS 10.13. My JAVA_HOME is: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home java -version java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode) I'm using R: 3.3.3 Here is sample code that also throws this same error: library(rJava) .jinit() # this starts the JVM s <- .jnew("java/lang/String", "Hello World!") (this is the "hello world" equivalent from the rJava site) I also tried to use Java 7 (rev. 51), which used to work, but that still fails. Also tried a fresh install of R/RStudio on another machine with the same results (same Java version, etc., however). I suspect Java itself is working fine since JDBC code from Java programs has no issues. Not sure why loading Java in R stopped working, but would appreciate any suggestions. Thanks very much, Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.