Displaying 20 results from an estimated 300 matches similar to: "A question about embedded R"
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
2000 Apr 01
1
Bug ? mine or ? in R core
Dear R Gurus,
I would very much appreciate some help with this code snippit
from my RODBC package.
R crashes or exhibits bizarre behaviour when repeatedly fetching
large numbers of rows.
Examples:
> odbcFetchRows(0,max=50000)->xx
> odbcFetchRows(0,max=50000)->xx
> odbcFetchRows(0,max=50000)->xx
> odbcFetchRows(0,max=50000)->xx
> odbcFetchRows(0,max=50000)->xx
3rd
2004 Feb 11
1
About the macro defined in Rinternals.h
Hello everyone,
I try to write a c++ code which calls embedded R and uses some of R
internal functions. What I read is just lots of macro names defined in
the Rinternals.h or Rdefines like R_Parse, Rf_install and so on. But
where can I get the detailed information about the parameters of these
macro? For example, what about the parameters of SEXP
R_ParseVector(SEXP, int, ParseStatus *)?
2004 Oct 08
2
R-2.0.0 findVar and findFun question
Dear all,
when working on a project with embedded R, I found out that R-2.0.0 causes
a problem where older versions worked OK.
Rf_findVar(...) causes the following error when used to find a generic function
(such as print):
fun = Rf_findVar(...);
R_tryEval(fun, ...);
Error in function (object, ...) : Invalid generic function in usemethod
Alternatively, using Rf_findFun(...) seems OK in this
2003 Dec 02
2
Two questions about the creating new package
Hello everyone,
I am just trying to colloct all my function into a new packages. I met
two questions which hurt me so much:
1. when I use the "prompt" to help to write Rd file for a variable x
which is character vector, say x <- c("a","b"), it always give the error
informaion:
Error in get(x, envir, mode, inherits) : variable "a" was not found.
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
2008 Aug 30
0
R embedded reinitialization error (PR#12644)
Full_Name: R Embedder
Version: 2.7.2
OS: win XP SP 2
Submission from: (NULL) (83.25.35.249)
I'm having problems using embedded R. I try to adapt examples from
"tests/Embedding/".
Everything works fine except when I try to reinitialize R for the second time
in the same program. I need to reinitialize correctly because my code
is some kind of .dll plugin to an external application.
2012 Mar 21
1
Trouble installing the XML package
Hello everyone,
I am probably not the only one having trouble with this package but here goes.
I want to install XML on Ubuntu. I installed libxml2-dev and
everything works out fine until I get the following:
Error in reconcilePropertiesAndPrototype(name, slots, prototype,
superClasses, :
No definition was found for superclass "namedList" in the
specification of class
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
2012 Oct 13
0
XML_3.95-0.1.tar.gz does not build on FreeBSD
I tried to build (and install) XML_3.95-0.1.tar.gz on FreeBSD
10.0-CURRENT amd64, but it stopped during the check of
R_HAS_REMOVE_FINALIZERS (full log appended):
----------------------------------
R CMD INSTALL XML_3.95-0.1.tar.gz
[..snip..]
Checking for 1.8: -DR_HAS_REMOVE_FINALIZERS=1
-I/usr/local/include/libxml2 -I/usr/local/include
Using libxml2.*
checking for gzopen in -lz... gcc46
2003 Aug 14
0
Simple C-R interface, SEXP and other declarations
I am trying to integrate OpenOffice Calc (OO) with R. One of the steps I am
taking is to create a very simple command line C program with the R shared
lib embedded in it. It would simply pass an R/S expression to R, print the
result, and catch errors. I know this is "overkill," but it is a step
toward something larger.
Has anyone done this before? If so, I would love to check out
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
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
2007 Jan 23
2
is it necessary to always register C routines with R_registerRoutines?
I am writing bindings to the neural network simulator SNNS.
At present I have used only .C interface, now I'm studying .Call interface.
I have adapted the example from page 77 of r-exts.pdf, however, it crashes
R.
I use MingW as recommended by Duncan Murdoch.
Please, tell me what I am missing.
The code is below.
Thank you.
SEXP snns_getVersion(void)
{SEXP version;
char *v;
2005 Feb 04
5
simple example of C interface to R
i'd like to use the C interface to R in a program i'm writing. as a
starting point, i'm trying to create a very simple C program that uses
R. i've read the R documentation on this, but i'm having trouble
figuring out where SEXP is defined and how to use it.
i noticed someone else on this list also tried to use the C interface,
but they ran into similar problems:
2004 Mar 06
2
.Call: is new attribute of protected object auto-protected
Hi,
I have an SEXP obj in a C function called via .Call(). The obj is
protected (in fact it is an argument to .Call and therefore
automatically protected). If I set an attribute of obj does the
attribute become protected too? Here is an example
SEXP foo(SEXP obj) {
SET_NAMES(obj, NEW_CHARACTER(3)); /* are names protected or not? */
...
}
Thanks,
Vadim
[[alternative HTML version
2009 Nov 27
1
Build of XML package failed
Hi list,
It may be a FAQ, but I searched the web and Uni of Newcastle Maths and Stats and
R mailing list archive on this issue but was unable to find a solution. I would
appreciate any pointer to help me solving this.
I am using R version 2.10.0 (2009-10-26) on linux mandriva 2010.0
I tried to install the XML_2.6-0.tar.gz package both with
install.packages('XML', dep=T) from within R
2008 Jan 29
2
Problem with new("externalptr")
Hi,
It seems that new("externalptr") is always returning the same instance, and
not a new one as one would expect from a call to new(). Of course this is hard
to observe:
> new("externalptr")
<pointer: (nil)>
> new("externalptr")
<pointer: (nil)>
since not a lot of details are displayed.
For example, it's easy to see that 2
2010 May 06
1
R on kdeedu-svn library problem
Hello,
I am new to this list. ?I am trying to compile the current svn version of
kdeedu on an amd64 linux machine ?which uses R and I get the following
compiler output.
-------------------------------------------
?79%] Building CXX object
cantor/src/backends/R/rserver/CMakeFiles/cantor_rserver.dir/rserver.o
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp: In member
function
2002 Jan 02
1
Building R-1.4 on Tru64
Hello everyone,
I've just attempted to build R-1.4 on Compaq Tru64 (I'll enclose the
text from bug.report() from R-1.3.1 at the end.) The relevant part of
the log is below.
Any ideas?
gcc -shared -o methods.so do_substitute_direct.o
methods_list_dispatch.o method_meta_data.o slot.o -L/usr/local/lib
/usr/ucb/ld:
Warning: Unresolved:
TYPEOF
Rf_error
Rf_protect
Rf_substitute