[Rcpp-devel] Limit of 20 on length of Rcpp::List::create?

Michael Hannon jm_hannon at yahoo.com
Wed Nov 2 20:16:23 CET 2011

> From: Douglas Bates <bates at stat.wisc.edu>

> On Tue, Nov 1, 2011 at 3:32 PM, Michael Hannon <jm_hannon at yahoo.com> wrote:
>> Greetings.  It appears that there is a limit of 20 items in a list created
>> by;
>>     Rcpp::List:create
>>  [...]

> Or go into Rcpp/inst/include/Rcpp/generated/vector__create.h and
> extend the limit of 20.
> In most cases if your list is getting very long you might want to
> consider another data structure or using something other than the
> ::create method for the List class to create your list.  The ::create
> method is a convenience construction to be able to quickly generate a
> List or other type of Vector (in the Rcpp sense) object, including
> assigning names.  It would be unusual to hard-code a call to
> List::create with more than 20 elements.

Yes, I see.  My colleague and I are just starting to use Rcpp and are in the
process of converting a mildly complicated piece of R code.  We got into the
habit of using Rcpp::List:create as a kind of glorified "cout", just so we
could compare the values returned by C++ against the values returned by R.
We're not actually using the structure for any of the calculations.

Thanks for your help.

-- Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20111102/03bf10d9/attachment.htm>

More information about the Rcpp-devel mailing list