It also includes "DataFrame_generated.h", which contains
automatically generated constructors with 1 to X (currently X=20)
"Named" arguments.

See it directly in the Subversion repo at R-Forge:

https://r-forge.r-project.org/scm/viewvc.php/pkg/Rcpp/inst/include/Rcpp/?root=r$

Davor


On Wed, 29 Feb 2012, Darren Cook wrote:

I wanted to understand what this code [1] actually does:

std::vector<double> vt, vpx, vsz;
std::vector<std::string> vsrc, vtype;
...
Rcpp::DataFrame df = Rcpp::DataFrame::create(
   Rcpp::Named("t", vt),
   Rcpp::Named("type", vtype),
   Rcpp::Named("src", vsrc),
   Rcpp::Named("px", vpx),
   Rcpp::Named("sz", vsz)
   );

Rcpp::Named(x,y) was easy [2]: it makes a little object that just stores
references to the two variables.

Understanding Rcpp::DataFrame::create() was harder [3], with 5
constructors, none of which seem like they would do the job. Can someone
give me a pointer to what I should study next.

TIA,

Darren


[1]: Extracted from:

http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-January/003345.html

[2]:
http://dirk.eddelbuettel.com/code/rcpp/html/Named_8h_source.html
http://dirk.eddelbuettel.com/code/rcpp/html/named__object_8h_source.html

[3]:
http://dirk.eddelbuettel.com/code/rcpp/html/DataFrame_8h_source.html

--
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to