Skip to content
Back to formatted view

Raw Message

Message-ID: <96EA4AD1-1EF2-4C12-807B-183E7F4F6733@r-enthusiasts.com>
Date: 2014-03-25T19:24:26Z
From: Romain Francois
Subject: [Rcpp-devel] Yet another instance of "function 'dataptr' not provided ..."
In-Reply-To: <CAO7JsnTnOd0N7ZSFRKEwBqAjZEOus0wjd27mOrYDQfWD+k34GA@mail.gmail.com>

You need to import something, anything from Rcpp?s namespace. Sent you a pull request. 

Le 25 mars 2014 ? 20:17, Douglas Bates <bates at stat.wisc.edu> a ?crit :

> I must have been away from writing R/Rcpp code for too long.
> 
> I started off trying to reproduce a calculation that is, literally, a one-liner in Julia.  See
> 
> http://nbviewer.ipython.org/gist/dmbates/9746197
> 
> Now admittedly the calculation of the sums of the n choose k possible subsets of size k from a vector or length n is aided by the fact that there is a combinations iterator in Julia.  Nonetheless it is pretty amazing that this can be written as
> 
> combsums(v::Vector, k) = [sum(c) for c in combinations(v,k)]
> 
> using this iterator and a comprehension.
> 
> I tried to write the combinations iterator in C++ but eventually tied myself in knots so I decided to back off and write a function that does the equivalent of the R function sample() and use that to generate a random sample from the distribution of sums.  
> 
> I have the C++ code working using Rcpp attributes but now I must generate a package.  I have to be missing something obvious because my attempt at
> 
> http://github.com/dmbates/randomizationTest
> 
> produces the dread "function 'dataptr' not provided ..." message when I try to invoke the R function randomsums.
> 
> Which of the many vignettes or manuals should I start reading?
> 
> (I can't believe I have spent two days going through innumerable contortions to try to achieve the effect of a one-liner.) 
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140325/745bdb73/attachment.html>