Displaying 20 results from an estimated 2000 matches similar to: "LENGTH function causing name conflict"
2006 Nov 15
1
Feature request: put NewEnvironment and R_NewhashedEnv into API
Hi,
I would like to be able to create new environments from package C
code. AFAICT, this isn't allowed since both NewEnvironment and
R_NewHashedEnv are declared in Defn.R.
If exposing this isn't controvertial, I would submit a patch.
However, I'm not sure where the declarations should go (Rdefines.h?)
and whether they need to change to Rf_*.
+ seth
2008 Oct 11
1
defines in Rmath.h and R_NO_REMAP
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
I'm programming with R 2.7.2 and had some trouble including
Rmath.h for its random variates generation routines: Although
I define R_NO_REMAP (which works fine for Rinternals.h stuff),
Rmath.h defines "beta" as "Rf_beta" etc., so that my "beta" strings
get redefined as well! Is this a feature?
I found an old
2007 Apr 18
1
undefined symbol: Rf_rownamesgets
I get the error
undefined symbol: Rf_rownamesgets
when I try to load my package, which include C++ code that calls that
function. This is particularly strange since the code also calls
Rf_classgets, and it loaded OK with just that.
Can anyone tell me what's going on?
For the record, I worked around this with the general purpose
attribute setting commands and R_RowNamesSymbol. I
2009 Sep 29
3
How do I access class slots from C?
Hi
I'm trying to implement something similar to the following R snippet using
C. I seem to have hit the wall on accessing class slots using C.
library(fPortfolio)
lppData <- 100 * LPP2005.RET[, 1:6]
ewSpec <- portfolioSpec()
nAssets <- ncol(lppData)
setWeights(ewSpec) <- rep(1/nAssets, times = nAssets)
ewPortfolio <- feasiblePortfolio(
data = lppData,
spec = ewSpec,
2011 Jan 20
1
Calling C++ from R
Hi All,
I am new to this area and use Rcpp to call C++ from R and try to build the
package under Windows 7. I use Rtools and R 2.10.1 32bit. Everything works
fine with me, except using R functions like "rnorm" or "runif" in the C++
code. When I use "R CMD check" the package, it always return error
** libs
making DLL ...
g++
2011 Mar 06
1
Plot and curve inside C++
Dear All,
I would like to use
- plot,
- curve
inside a C++ program. What R package do you recommend? Rcpp?
Thanks in advance,
Paul
2000 Jun 26
2
Looking for protect()
Hello:
This is a simple, I hope, question about the first example in section 3.6.4
of the manual, "Writing R extensions."
I'm using R 1.1.0, and below I list some easy code that I got from section
3.6.4. When I try to compile the file out.c under NT 4, using VC++ 6.0, I
get the following error messages:
Compiling...
out.c
Linking...
out.obj : error LNK2001: unresolved external
2012 Feb 19
2
include <R.h>
I am trying to add
#include <R.h>
to a .c file in one of my package, so I can call error() without a
complaint about implicit defined function. The src/ has a Makefile, to
build some exec/ files that are needed. Without the include, my Makefile
target
OBJS = $(SRC:.c=.o)
$(PKGNAME).so: $(OBJS) rpcx.h
$(R_HOME)/bin/R CMD SHLIB $(OBJS)
seems to work fine, and I do not need a target
2005 Jul 01
1
C/C++ namespaces
Dear community,
this is just a suggestion, but might be useful for the following R
releases.
I was programming some C code for R and my compiler constantly showed me
some crazy messages that a stdc++ macro length() was supplied with 4
arguments whereas only one was required. The problem could be partially
resolved by changing the order of includes. However as soon as the file
was used from
2011 Aug 13
1
Latent flaw in SEXPREC definition
There seems to be a latent flaw in the definition of struct SEXPREC
in Rinternals.h, which likely doesn't cause problems now, but could
if the relative sizes of data types changes.
The SEXPREC structure contains a union that includes a primsxp,
symsxp, etc, but not a vecsxp. However, in allocVector in memory.c,
zero-length vectors are allocated using allocSExpNonCons, which
appears to
2011 Oct 08
0
Fatal Error: unable to load base package
*Dear All*
*
*
*I am able to compile the simple program given in the site
http://dirk.eddelbuettel.com/code/rinside.html, but when i execute it a
dialog appear saying "Fatal Error: unable to load base package". Please
help.*
*
*
*With regards*
*
*
*Sudhabrata Majumder*
*
*
This is the source code
#include <RInside.h> // for the embedded R via RInside
int
2014 Oct 22
1
Problems to compile examples of RInside
Hello,
I have some problems to migrate to R >3.0 my devel machine (R.2.15.2). So I decided to start from scratch with a brand new virtual machine.
Downloaded latest network install of debian testing, not stable (jessie/sid, SMP Debian 3.16.3-2 (2014-09-20) x86_64 GNU/Linux) installed only with ssh-server and basic utilities (no X).
Then I installed R by:
apt-get install
2007 Feb 25
3
R/C++/memory leaks
Dear all,
I have wrapped a C++ function in an R package. I allocate/deallocate
memory using C++ 'new' and 'delete'. In order to allow user
interrupts without memory leaks I've moved all the delete statements
required after an interrupt to a separate C++ function freeMemory(),
which is called using on.exit() just before the .C() call.
I am concerned about the
2009 Sep 03
1
Running an expression 1MN times using embedded R
Hello,
I'm evaluating this expression
expression({ for(x in 1:5){ .Call('rh_status','x') }})
a million times from a program with R embedded in it. I have attached
reproducible code that crashes with
Program received signal SIGSEGV, Segmentation fault.
0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309
1309 FORWARD_NODE(R_PPStack[i]);
Current language:
2005 Mar 16
1
function-like macros undefined
Hi,
Somehow function-like macros from Rinternals.h are not defined when I
include the file.
foo.c
##################
#include <R.h>
#include <Rinternals.h>
#ifndef NILSXP
#error("NILSXP")
#endif
#ifndef INTEGER
#error("INTEGER")
#endif
###################
When compiled:
vor/src% gcc -I/usr/local/lib/R/include -g -O2 -c foo.c -o foo.o
foo.c:11:2: #error
2011 Jan 26
2
Dealing with R list objects in C/C++
Hi,
I'd like to construct an R list object in C++, fill it with relevant data, and pass it to an R function which will return a different list object back. I have browsed through all the R manuals, and examples under tests/Embedding, but can't figure out the correct way. Below is my code snippet:
#include <Rinternals.h>
// Rf_initEmbeddedR and other setups already performed
2013 May 24
1
Problem with Rboolean in c++ code
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is
properly deleted after use. However, I run into some problems when
trying to pass in the third argument which is an Rboolean. The line
'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following
error when trying to compile using R CMD SHLIB:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O2 -pipe
2009 Jan 05
1
can't get names of R_env
Hi,
I'm quite knew in R, so I might not have the R specific jargon.
But here is my problem,
I'm trying to access and use variabels given by a function environment,
more specifically the rho in do_optim in src/main/optim.c
According to the documentation
http://cran.r-project.org/doc/manuals/R-ints.html#The-_0027data_0027
the envsxp is defined as a tagged pairlist.
"ENVSXP: Pointers
2009 Aug 25
2
Clarifications please.
Hi
I think I have asked these questions earlier, but I been able to find
answers from the documentation (which I found poorly written in several
places). Will someone be kind enough to give me answers and enlighten me?
(as in explain with CODE?)
I want to embed R in my application and use the fPortfolio package for
carrying out risk management computations. Right now I'm reading the
Rmetrics
2009 Dec 26
1
Problem compiling R library on FC4 ( conflicting declaration in Rinterface.h and stdint.h)
Hello,
The package builds successfully on RHEL5 and OS X( 64 bit,32/64
respectively) but on FC4(32 bit) it fails with this error
g++ -m32 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -I. -g `pkg-config --cflags protobuf`
-Wall -c