If I remember correctly, environments use hash tables to lookup names.
In pure R to check if an element L[["key"]] exists I would usually use
> "key" %in% names(L)
which seems to be reasonably fast. `%in%` works in vectors, too
> keys %in% L
returning exactly what Dirks suggestion was supposed to
;-(
Jonas
On Thu, Oct 6, 2011 at 12:18 AM, Dirk Eddelbuettel wrote:
>
> On 5 October 2011 at 16:59, Douglas Bates wrote:
> | On Wed, Oct 5, 2011 at 2:45 PM, Dirk Eddelbuettel
> wrote:
> | >
> | > On 5 October 2011 at 14:07, Douglas Bates wrote:
> | > | O
I am using the deSolve package successfully and I think it is probably your
best option if you want to do things in R.
The most widespread solver in C++ is the Sundials Suite as far as I know:
https://computation.llnl.gov/casc/sundials/main.html
I think someone starting writing an interface to R, b
Hi,
I don't have access to a computer with R atm so I can't try. But the
includes="#include , #include , #include .
#include "
looks fishy to me. First of all, note the dot before the last "include"
instead of a comma. Secondly: wouldn't you need something like the below?
includes=c("#include ","#i
It's in the inline package in the file
R/cfunction.R
Jonas
On Wed, Aug 24, 2011 at 6:49 AM, Darren Cook wrote:
> Trying to understand some of the Rcpp/inline internals I was led to a
> call to compileCode() [1]. This is called from both cxxfunction and
> cfunction, but I cannot find it anywher
ction is very expensive to
evaluate and is implemented in R using Rcpp and various other R libraries.
Using OpenOpt allows to try a lot of different solvers without having to
change my implementation.
On Mon, Aug 15, 2011 at 2:59 PM, Dirk Eddelbuettel wrote:
>
> On 15 August 2011 at 10:00,
On 12 August 2011 at 14:33, Jonas Rauch wrote:
> | Hi Dirk and Romain,
> |
> | Aparrently libR is not loaded by rpy2, at least not in a way such that
> Rcpp can
> | access it. I have solved the problem by adding -lR to the linker flags
> when
> | building Rcpp. Since for normal u
Makevars file in a future
version of Rcpp? Or does this lead to problems in case R is build without
libR.so?
Best regards,
Jonas
-- Forwarded message --
From: Jonas Rauch
Date: Fri, Aug 12, 2011 at 10:36 AM
Subject: Rcpp and rpy2
To: rcpp-devel
Is Rcpp compatible with rpy2?
I
Is Rcpp compatible with rpy2?
I would like to call a very complex R function from python. My function
depends on code implemented with Rcpp. When I try to load Rcpp from python
via
import rpy2.robjects as robjects
robjects.r('library(Rcpp)')
I get the following:
Error in dyn.load(file, DLLpath =
, Douglas Bates a écrit :
>>
>>> On Wed, Jun 15, 2011 at 6:38 AM, Jonas
>>> Rauch> wrote:
>>>
>>>> Hey again,
>>>>
>>>> just to clarify: The final solution was to implement all methods of the
>>>> derived cl
Just as a remark:
As a long term R user I have to object to your use of "=" in the R code
(e.g. on page 20). There is a difference between the operator "<-", which us
usually used for assignment, and "=", although in your examples they do the
same [1].
Best regards,
Jonas
[1] http://stat.ethz.ch/
I had the same problem before I realized that when a Module is loaded as
part of a package (instead of manually loading the shared lib) you don't
need the whole
> Module('yada','test')$ ...
just try
>bla()
The exposed classes and functions are automatically made available in the
namespace of the p
but works perfectly.
Best regards,
Jonas
On Wed, Jun 15, 2011 at 7:16 AM, Jonas Rauch wrote:
> Actually, having just the declaration like this compiled fine but and ended
> up in an unresolved symbol when loading the library.
>
> class Bar : public Foo {
> ...
>
On a related note to the question on derived classes I sent yesterday, here
is another interesting idea. Assume I have classes
class Foo {
...
};
class Bar {
...
//pass Foo pointer as parameter
void myMethod(Foo* X) {
...
}
//or Foo reference
void myMethod2(Fo
,
Jonas
On Tue, Jun 14, 2011 at 7:36 PM, Dirk Eddelbuettel wrote:
>
> Hi Jonas,
>
> On 14 June 2011 at 19:06, Jonas Rauch wrote:
> | I am trying to write an R interface to a library that uses derived
> classes in
> | the following manner:
> |
> | class Foo {
> | .
implementations of "Action".
Is it possible to expose Bar::doSomething() to R using Rcpp modules? I have
tried different things and did not get it to work.
I would appreciate any help.
Best regards,
Jonas Rauch
___
Rcpp-devel mailing list
Rcpp-devel@lists
16 matches
Mail list logo