Displaying 20 results from an estimated 800 matches similar to: "Bug ? mine or ? in R core"
2003 Dec 10
0
C++: SET_LENGTH() Over Many Iterations?
In a C++ extension to R (v 1.8.1), I've been experimenting with a
generic "push back" function to tack one value at a time onto the end
of an R vector created within the extension. After calling this
function a certain number of times Rgui.exe (I'm writing in Windows
using Visual Studio .NET 2003) will fail with an Access Violation,
which doesn't happen when I pre-allocate
2003 Dec 12
3
C++: Appending Values onto an R-Vector.
Hi folks. I posted this question a few days ago, but maybe it got lost
because of the code I included with it. I'm having a problem using the
SET_LENGTH() macro in an R extension I'm writing in C++. In a function
within the extension I use SET_LENGTH() to resize R vectors so as to
allow the concatenation of single values onto the vectors -- it's a
"push back" function to
2005 Aug 29
1
Question about SET_LENGTH
Hello all, thanks for all the help on the other issues. This one should
be relatively straightforward. I have a vector of integers which I
allocate to be the maximal size possible (meaning I'll never see more
than cel.GetNumOutliers, but most likely I'll see less) therefore, I
want to resize the vector, one solution would be to allocate a new
vector then to copy into the new vector. That
2005 Apr 16
1
SET_LENGTH
Hello.
I'm trying to read a delimited file. I'm a little new
to the R api. In the program, I do something like
this...
/*****************************/
SEXP retval;
PROTECT(retval = allocMatrix(STRSXP,1,names.dim));
int r_eltctr = 0;
while(!myfile.eof())
{
SET_LENGTH(retval,r_eltctr+num_of_fields);
for(int i = 0;numofcolumns; ++i)
{
INTEGER(retval)[r_eltctr++] = 1;/*some
2006 Aug 21
1
return tree from .Call
Hello:
I was hoping to get some advice about how to return a tree (basically a
linked list -- with each node containing a parent, left, and right node
pointers) from a C routine back into R. Each node itself contains several
attributes (a double, a char *, an int, and a void * )
Initially I was thinking I could just return to R a SEXP containing a
pointer to the Root Node, but then realized
2004 Apr 06
1
A question about embedded R
Hello everyone,
I met a strange problem when I call R expression from C++, here is the
details:
I edited a function eval_R_command();
double eval_R_command(const char *funcName)
{
SEXP exp,e;
ParseStatus status = PARSE_OK;
int i,n;
double val;
PROTECT(exp=NEW_CHARACTER(1));
SET_STRING_ELT(exp, 0, COPY_TO_USER_STRING(funcName));
PROTECT(e = R_ParseVector(exp, 1,
2006 Dec 28
0
RODBC not working when connecting to a Sybase database
What is this error message about and how do I troubleshoot it?
> sqlTables(channel)
Error in .Call("RODBCFetchRows", attr(channel, "handle_ptr"), max, buffsize, :
negative length vectors are not allowed
The channel was created as such
channel <- odbcConnect("Labdata")
I think this is telling me that my odbcConnect command worked
>
2013 Jun 27
3
Read a text file into R with .Call()
Hi,
I want to read a text file into R with .Call().
So I define some NEW_CHARACTER() to store the chracters read and use SET_STRING_ELT to fill the elements.
e.g.
PROTECT(qNames = NEW_CHARACTER(10000));
char *foo; // This foo holds the string I want.
while(foo = readLine(FN)){
SET_STRING_ELT(qNames, i, mkChar(foo)));
}
In this way, I can get the desired character from qNames. The only problem
2004 Aug 18
3
R as shared library
Hello folks,
I'm embarking on a project to embed R into the Apache web server, and
I'd like your help. Currently, I'm looking for a way for R code to call
back into a shared library from which the R shared library was loaded.
Essentially, apache starts and loads mod_R.so which runs an
initialization routine which calls Rf_initEmbeddedR() and the following
code:
/* override to
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 17:27, David Greene wrote:
> > Here's the updated patch.
>
> Well, that didn't go through right. Here it is again.
Argh! Stupid bug fixed. :)
Index: include/llvm/Support/circular_raw_ostream.h
===================================================================
--- include/llvm/Support/circular_raw_ostream.h (revision 0)
+++
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 18, 2009, at 3:46 PM, David Greene wrote:
>
> + /// circular_raw_ostream - A raw_ostream that saves its output in a
> + /// circular buffer.
A better description would be "which *can* save its data to a circular
buffer, or can pass it through directly to an underlying stream if
specified with a buffer of zero."
When it is buffering, what causes it to flush? Your
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 13:56, David Greene wrote:
> On Friday 18 December 2009 13:53, David Greene wrote:
> > > > + void releaseStream() {
> > > > + // Delete the stream if needed. Otherwise, transfer the buffer
> > > > + // settings from this raw_ostream back to the underlying
> > > > stream. + if (!TheStream)
> > >
2012 Jul 30
1
why querying Sybase IQ using RODBC returns error ?
Hello,
I am not able to query Sybase IQ database from R using RODBC package.
Check the below code
R> sybaseiq.query <- function (sql, ..., as.is = FALSE)
{
connstr <- "Driver={Sybase
IQ};UID=ajadhav2;PWD=*****;ServerName=PSGSESHR01A_IQ;CommLinks=SharedMemory,TCPIP{host=psgseshr01_iq.sg.csfb.com;port=3051}"
chan <- odbcDriverConnect(connstr)
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 17:22, David Greene wrote:
> On Friday 18 December 2009 13:56, David Greene wrote:
> > On Friday 18 December 2009 13:53, David Greene wrote:
> > > > > + void releaseStream() {
> > > > > + // Delete the stream if needed. Otherwise, transfer the
> > > > > buffer + // settings from this raw_ostream back to
2007 Jun 06
3
C function with unknown output length
Hi all,
Could anyone point me to one or more examples in the R sources of a C
function that is called without knowing in advance what will be the
length (say) of the output vector?
To make myself clearer, we have a C function that computes
probabilities until their sum gets "close enough" to 1. Hence, the
number of probabilities is not known in advance.
I would like to have an
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 19:47, Chris Lattner wrote:
> On Dec 18, 2009, at 3:46 PM, David Greene wrote:
> > + /// circular_raw_ostream - A raw_ostream that saves its output in a
> > + /// circular buffer.
>
> A better description would be "which *can* save its data to a circular
> buffer, or can pass it through directly to an underlying stream if
> specified
2002 May 30
2
RODBC & Problems with Sybase Database
Hello,
i would like import Data from Sybase DataBase to R-1.5.0 via RODBC.
With this i get a connection without problems !
channel <- odbcConnect("ODBCName","LoginName","LoginPass")
dataSybase <- sqlFetch(channel,"EPORT_XYZ")
,but when i try this i get a message error ?
(Perhaps the _ is a problem, i know that's i.e. not usual to name
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Wednesday 16 December 2009 13:35, David Greene wrote:
> > Please make BufferSize an 'unsigned' and default it to 8192. Please use
> > PRESERVE_STREAM instead of 'false'.
Here's an updated version of the circular buffer. Ok to check in?
-Dave
Index: include/llvm/Support/circular_raw_ostream.h
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 17, 2009, at 3:41 PM, David Greene wrote:
> On Wednesday 16 December 2009 13:35, David Greene wrote:
>
>>> Please make BufferSize an 'unsigned' and default it to 8192. Please use
>>> PRESERVE_STREAM instead of 'false'.
>
> Here's an updated version of the circular buffer. Ok to check in?
This is looking a lot better, here are some more
2009 Dec 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 12:28, Chris Lattner wrote:
> This is looking a lot better, here are some more comments:
> > + /// current_pos - Return the current position within the stream,
> > + /// not counting the bytes currently in the buffer.
> > + virtual uint64_t current_pos() {
>
> I didn't notice this earlier, but is there any reason for current_pos