search for: rconnections

Displaying 20 results from an estimated 76 matches for "rconnections".

Did you mean: connections
2006 Oct 09
1
Discussion starter for package level Connection API
Thought I'd try and start a discussion. Feel free to jump in. I guess R needs to strike the right balance between opening up the internals to package writers and not allowing them to do bad things. My first attempt at cracking this nut is to just memcpy() the Rconnection and not allow access to the private stuff: /* Alternative to allowing C code access to connection API. */ Rconnection
2005 Aug 22
2
RFC: "loop connections"
..., PREC_FN, 0}}, {"socketConnection",do_sockconn,0, 11, 6, {PP_FUNCALL, PREC_FN, 0}}, {"sockSelect",do_sockselect,0, 11, 3, {PP_FUNCALL, PREC_FN, 0}}, {"getAllConnections",do_getallconnections,0,11, 0, {PP_FUNCALL, PREC_FN, 0}}, --- src/include/Rconnections.h.orig 2005-04-18 04:34:02.000000000 -0700 +++ src/include/Rconnections.h 2005-08-22 15:40:02.582767400 -0700 @@ -82,19 +82,19 @@ int cp; } *Rgzfileconn; -typedef struct textconn { +typedef struct loopconn { char *data; /* all the data */ int cur, nchars; /* current pos and numbe...
2007 May 20
0
Problems accessing Rconnect
Hi. I nearly have Rserve working.... I have the dialog box which says.. Rserve: Ok, read to answer queries. Having read all i can find, I followed the guidance given on http://rosuda.org/Rserve/example.shtml I tried to follow the first example but I am getting an error descirbed below. My IDE looks like this: http://www.nabble.com/file/p10705244/ide.jpg However, when I try and compile my
2005 Aug 22
1
Fetching Warning Messages
Hi, I am facing one problem of fetching R warning messages in Java Code using Rserve. It is easier to trap R Error messages by using catching RSrvException. I came to know one way of fetching R Warning messages, i.e. using "withCallingHandlers", below is my Java Program, which uses withCallingHandlers of R : import org.rosuda.JRclient.*;
2009 Jun 12
0
JRclient.RSrvException Exception: Handshake
Hi all, first of all: Sorry for my bad englis, and now the Question: I have some problems with running R from Java. First i tried using rJava (JRI). But the examples didnt work properly. Now im trying to establish a connection by using Rserve and JRclient (RF503). I have the following code, which i`ve found: ------------------------------------------------------------------------ public
2005 Sep 18
0
Updated rawConnection() patch
...XP do_clearpushback(SEXP, SEXP, SEXP, SEXP); SEXP do_textconnection(SEXP, SEXP, SEXP, SEXP); +SEXP do_graboutput(SEXP, SEXP, SEXP, SEXP); SEXP do_getallconnections(SEXP, SEXP, SEXP, SEXP); SEXP do_sumconnection(SEXP, SEXP, SEXP, SEXP); SEXP do_download(SEXP, SEXP, SEXP, SEXP); --- ./src/include/Rconnections.h.orig 2005-08-03 08:50:36.000000000 -0700 +++ ./src/include/Rconnections.h 2005-09-17 23:56:01.875475000 -0700 @@ -94,8 +94,7 @@ typedef struct outtextconn { int len; /* number of lines */ - SEXP namesymbol; - SEXP data; + SEXP namesymbol, data, venv; char *lastline; in...
2017 Oct 26
3
How to create a table structure in Java code?
That's amazing! Thank you!!! One follow up question, if that's OK? If, instead of using hard-coded CSV, I read the CSV into a variable first, then it fails again with a parse error. Code below. So, if I read the CSV into a variable, do I need an additional wrapper method? Seems like it should still work. Thanks in advance for your reply. -M String inputIris =
2017 Oct 25
2
How to create a table structure in Java code?
Hi all, Using RConsole, it's easy to get data from the database that you can use in an R Command. Like this: (Reference case) irisQuery <- dbGetQuery(conn, "select * from iris") boxM(irisQuery [,-5], irisQuery[,5]) ---- (Actual case this posting is about) Yet, if I'm getting that same (sample IRIS) data, say, in a web service possibly POSTED from a SQL command, that same
2009 Mar 19
4
Import R-output into Java
Hello, I want to import R-output via Rserve to Java, especially for the function ctree from the package party. Rserve is working properly. Yet, I only get the predictions with the Java code try{ RConnection c = new RConnection(); ... c.voidEval("modell <- ctree(...)"); REXP y = c.eval("nodes(modell,1)[[1]]$prediction"); ...
2009 Nov 07
1
getConnection, R_outpstream_st
Hello, I'm trying to use the limited connections api defined in Rinternals.h. I have code that looks like this (inspired from do_serializeToConn) : SEXP serialize_to_connection( SEXP xp, SEXP connection ){ Rconnection con ; struct R_outpstream_st out; R_pstream_format_t type = R_pstream_binary_format ; SEXP (*hook)(SEXP, SEXP) = NULL ; con = getConnection(Rf_asInteger(connection));
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...s. * We have run the tests on macOS, Debian Linux and Windows 2016 Server. You can also browse the changes here: https://github.com/gaborcsardi/r-source/pull/3/files You can also download the diff below from https://github.com/gaborcsardi/r-source/pull/3.diff Best, Gabor diff --git a/src/include/Rconnections.h b/src/include/Rconnections.h index a2c53f058f..32bb35e31f 100644 --- a/src/include/Rconnections.h +++ b/src/include/Rconnections.h @@ -36,6 +36,7 @@ typedef enum {HTTPsh, FTPsh, HTTPSsh, FTPSsh} UrlScheme; typedef struct urlconn { void *ctxt; UrlScheme type; + char *headers; } *Rur...
2017 Oct 26
1
How to create a table structure in Java code?
Thanks! I just figured it out (thanks to "Beyond Compare") and was coming here to post back. The boxM test doesn't work with that (now, finally working) REXP structure, but I probably now need to create a table or something and parse that structure. So much fun! :) Thanks again. - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. > --------
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
It can't be this hard, right? I really need a shove in the right direction here. Been spinning wheels for three days. Cannot get past the errors. I'm doing something wrong, obviously, since I can easily compute the Box's M right there in RStudio But I don't see what is wrong below with the coding equivalent. The entire code snippet is below. The code fails below on the call to
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
I'm not sure what you mean. Could you please be more specific? If I print the string, I get: boxM(boxMVariable[, -5], boxMVariable[, 5]) From this code: . . . // assign the data to a variable.rConnection.assign("boxMVariable", myDf); // create a string command with that variable name.String boxVariable = "boxM(boxMVariable[, -5], boxMVariable[, 5])";
2017 Oct 26
0
How to create a table structure in Java code?
You are entering the quoting hell - you are missing quotes and escapes for \n. it would be much more reasonable to use the rConnection.assign method instead of pasting any content through the parser. Cheers, Simon > On Oct 26, 2017, at 9:59 AM, Morkus via R-devel <r-devel at r-project.org> wrote: > > That's amazing! Thank you!!! > > One follow up question, if
2009 Mar 11
1
RServe
Dear all, I'm trying to use R-functions from Java. I want to use the Package Rserve. Everthing is installed and I can run my Java-testprogramm. ... Rconnection r = new Rconnection(); double[] d = r.eval("rnorm(10)").asDoubleArray(); ... But now I get always arrays with ten "0.0", which is not correct I suppose, that is is a problem from R, because at the fist time (last
2007 Aug 27
1
fix for broken largefile seek() on 32-bit linux (PR#9883)
...2664) +++ src/extra/zlib/gzio.c (working copy) @@ -25,7 +25,7 @@ #include "zutil.h" /* R ADDITION */ -#if defined(HAVE_OFF_T) && defined(HAVE_SEEKO) +#if defined(HAVE_OFF_T) && defined(HAVE_FSEEKO) #define f_seek fseeko #define f_tell ftello #else Index: src/include/Rconnections.h =================================================================== --- src/include/Rconnections.h (revision 42664) +++ src/include/Rconnections.h (working copy) @@ -63,7 +63,7 @@ typedef struct fileconn { FILE *fp; -#if defined(HAVE_OFF_T) && defined(HAVE_SEEKO) +#if defined(HAVE...
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Thanks Duncan. Awesome ideas! I think we're getting closer! I tried what you suggested and got a possibly better error... . . . rConnection.assign("boxMVariable", myDf); String resultBV = "str(boxMVariable)"; // your suggestion. RESULTING ERROR: Error in format.default(nam.ob, width = max(ncn), justify = "left") : invalid 'width' argument (No idea
2017 Oct 26
0
How to create a table structure in Java code?
I suspect that you are looking for something like: read.csv(textConnection( "5.1,3.5,1.4,0.2,setosa 4.9,3,1.4,0.2,setosa 4.7,3.2,1.3,0.2,setosa 4.6,3.1,1.5,0.2,setosa 5,3.6,1.4,0.2,setosa" ), header = FALSE) HTH, Jan On 25-10-17 12:50, Morkus via R-devel wrote: > Hi all, > > Using RConsole, it's easy to get data from the database that you can use in an R Command. Like
2008 Jul 02
1
Extracting regression coef. and p-values in JRClient
Hi there, I am using JRClient to build logistic regression model in the following manner : Rconnection c = new Rconnection(); c.eval("KSN<-read.table(\"/Users/amine/Documents/Research/ Tools/R/D2R1.txt\",header=T,sep=\",\")"); c.eval("result <- glm(Nausea ~ Kaletra*Sustiva, family = binomial(link = logit), data =KSN)");