Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Antonio Piccolboni
> On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni < > anto...@piccolboni.info> wrote: > >> Check here >> <https://github.com/RevolutionAnalytics/rmr2/blob/master/pkg/src/t-list.cpp> >> for something similar to Tim's solution that preallocates all vector

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-03 Thread Antonio Piccolboni
Check here for something similar to Tim's solution that preallocates all vectors to avoid the costly push_back. Still needs the unlists in R, so it's expensive in that dimension, the number of lists in the output. Antoni

[Rcpp-devel] calling and R function from rcpp and evaluation

2014-02-05 Thread Antonio Piccolboni
Hi, I was wondering why I can serialize a call such as in serialize(call("ripley"), NULL) [1] 58 0a 00 00 00 02 00 03 00 02 00 02 03 00 00 00 00 06 00 00 00 01 00 04 00 09 00 00 00 06 72 69 70 6c 65 79 00 00 00 fe but if I try from C++ the call gets evaluated library("Rcpp") rcpp.serialize =

[Rcpp-devel] why is memory freed in assignment to RObject

2014-01-25 Thread Antonio Piccolboni
Hi, I develop a package called rmr2 and we've run into some hard-to-track instability of late. R CMD check fails on an assertion, but if we execute the same test any other way (interactive, batch, vanilla, anything) it passes. If we comment out that test, R CMD check fails somewhere else. I suspect

Re: [Rcpp-devel] "transposing" a list

2013-11-26 Thread Antonio Piccolboni
That worked, thanks Antonio On Tue, Nov 26, 2013 at 2:48 PM, Dirk Eddelbuettel wrote: > > On 26 November 2013 at 14:26, Antonio Piccolboni wrote: > | Hi all, > | I have a list of lists, the inner lists all of the same lengths. I would > like > | to create a new list of lis

[Rcpp-devel] "transposing" a list

2013-11-26 Thread Antonio Piccolboni
Hi all, I have a list of lists, the inner lists all of the same lengths. I would like to create a new list of lists such that ll[[i]][[j]] == tll[[j]][[i]]`, where the old one is ll and the new one is tll. In R this can be achieved by the function f = splat(mapply.list) mapply.list = function

Re: [Rcpp-devel] loading a souceCpp-ed function

2013-01-29 Thread Antonio Piccolboni
Since that directory will > survive across sessions, your C++ function would of course also. > > J.J. > > On Tue, Jan 29, 2013 at 4:20 PM, Antonio Piccolboni > wrote: > > Hi, > > I defined a little C++ function and sourced it with sourceCpp, tested, > works > > gre

[Rcpp-devel] loading a souceCpp-ed function

2013-01-29 Thread Antonio Piccolboni
Hi, I defined a little C++ function and sourced it with sourceCpp, tested, works great. It so happens that I develop a package to interface R and Hadoop, and I need to use the same function in the map or reduce parameter of a mapreduce call. This means that the definition of the function will have

[Rcpp-devel] access to element of generic data frame

2012-06-25 Thread Antonio Piccolboni
Hi, is there a a way to access a specific element of a data frame in Rcpp without previous knowledge of the type of the columns? I see from RcppExamples that one can do something like: // construct the data.frame object Rcpp::DataFrame DF = Rcpp::DataFrame(Dsexp); // and access each column by nam

Re: [Rcpp-devel] Differences between RcppEigen and RcppArmadillo

2012-06-18 Thread Antonio Piccolboni
wrote: > > On 18 June 2012 at 11:55, Antonio Piccolboni wrote: > | > | > | On Sun, Jun 17, 2012 at 9:09 PM, c s wrote: > | > | Another is > | R. I believe R currently doesn't have a JIT compiler (I haven't > | checked lately), and hence the very us

Re: [Rcpp-devel] Differences between RcppEigen and RcppArmadillo

2012-06-18 Thread Antonio Piccolboni
On Sun, Jun 17, 2012 at 9:09 PM, c s wrote: > Another is > R. I believe R currently doesn't have a JIT compiler (I haven't > checked lately), and hence the very useful Rcpp fills in the > performance gap. > Still work in progress but see http://www.milbo.users.sonic.net/ra/jit.html. Doesn't