I'm trying to build an R package which exposes functions which depend on
Google's re2 library. In order to do that, I need to depend on
/usr/local/include/re2.h.
That's really easy in the main cpp files, since #include works The
problem arises when I use compileAttributes() to generate an
RcppEx
b 19, 2013 at 3:26 PM, Ken Williams
wrote:
>
>
> > From: John Merrill [mailto:john.merr...@gmail.com]
> > Sent: Tuesday, February 19, 2013 5:24 PM
> > To: Ken Williams
> > Cc: Yan Zhou; Dirk Eddelbuettel; rcpp-devel@lists.r-forge.r-project.org
> > Subject: Re: [Rcp
I'm a little puzzled by your question. Could you use a reference instead
of instantiating a new copy?
On Tue, Feb 19, 2013 at 3:19 PM, Ken Williams
wrote:
>
>
> > -Original Message-
> > From: Yan Zhou [mailto:zhou...@me.com]
> > Sent: Tuesday, February 19, 2013 5:10 PM
> > To: Dirk Edde
There is a sleazy hack which works, but wastes a fair amount of memory:
take the transpose of the matrix in R, and use the fact that the columns of
that transpose are the rows of the original.
On Mon, Feb 18, 2013 at 5:37 PM, Dirk Eddelbuettel wrote:
>
> On 18 February 2013 at 17:02, Kevin Ushe
colname;
> colname << < "X." << j;
> col_names(j) = colname;
> }
>
>
> Davor
>
>
> On 2013-01-18, at 3:25 PM, John Merrill wrote:
>
> Sure. I'll write something up for the gallery, but here's the crude
> outline.
>
3:21 AM, Romain Francois
wrote:
> Le 15/01/13 16:20, John Merrill a écrit :
>
> It appears that DataFrame::create is a thin layer on top of the R
>> data.frame call. The guarantee correctness, but also means the
>> performance of an Rcpp routine which returns a large data
Have you tried running your code within a debugger? It's pretty
straightforward to do that, either by building a package and loading the
resulting library or by using sourceCpp. Here's a simple standard session
using the following file (named '/tmp/zero_ref.cc' on my system) as input:
#include
- replicate(250, 1:100, simplify=FALSE)
> system.time(replicate( { as.data.frame(a) ; NULL }, n=100))
user system elapsed
3.890 0.000 3.892
> system.time(replicate( { BuildCheapDataFrame(a) ; NULL }, n=100))
user system elapsed
0.020 0.000 0.022
Yes, that really is a facto
utine which takes seconds. So, pragmatically, in Rcpp, I can get a
rough factor of sixty, it appears.
On Thu, Jan 17, 2013 at 7:46 PM, Paul Johnson wrote:
> On Tue, Jan 15, 2013 at 9:20 AM, John Merrill
> wrote:
> > It appears that DataFrame::create is a thin layer on top of t
w. You must know that data.frame IS a list of variables, which can be
> vectors (though not always) and can only be faster than a list of lists.
>
> Best,
>
> Yan
>
>
> On Jan 15, 2013, at 03:20 PM, John Merrill wrote:
>
> It appears that DataFrame::create is a thin laye
It appears that DataFrame::create is a thin layer on top of the R
data.frame call. The guarantee correctness, but also means the performance
of an Rcpp routine which returns a large data frame is limited by the
performance of data.frame -- which is utterly horrible.
In the current version of R, t
I just built a source package on a 0.10.1 box for the first time;
previously, I'd always built it on 0.9.15 boxes. I was surprised to see
that I now need to do string comparisons to character SEXP's using the
CHAR() macro; previously, I'd been able to use the SEXP from a StringVector
directly.
I'
What about 'concat', 'cat', or 'concatenate'? The function concatenates
vectors, and 'concat' and 'cat' are well-known short forms of the word.
(The Unix program 'cat' is so-named because it concatenates text files.)
On Thu, Dec 13, 2012 at 7:20 AM, Walter Mascarenhas <
walter.mascaren...@gmail
There's a small issue with that -- if your columns contain any
character lists, then those columns wind up being coerced into factors
by as.data.frame (inside the constructor). You can work around that
by either setting the default value of the stringsAsFactors option to
FALSE, and then resetting
r 2012 at 18:59, John Merrill wrote:
> | Is there a way to do this using inline?
>
> Maybe.
>
> I tend to write packages. That is the way we documented, and still recommend.
>
> Dirk
>
> --
> Dirk Eddelbuettel | e...@debia
tl;dr summary -- is there a way to incorporate multiple functions into
an inline call? Specifically, is there a way to include a templated
function in an inline compilation?
Consider the following outline:
template
void InsertTypedVector
}
RcppExport SEXP ExposedFunction(SEXP r_foobar) {
Dat
16 matches
Mail list logo