On 12 January 2013 at 02:23, Wu Wush wrote:
| In my experience, we could write some functions based on exposed API:
| - Query a subset of xts object based on row
| subset(`Rcpp::DatetimeVector` or integer vector) and column
| subset(string vector or integer vector)

That does not necessarily need the xts API.  As the data of an xts is just a
numerical matrix we can access the matrix directly -- and the index is a
vector of datetimes.  I sketched something in a post on the Rcpp Gallery:

    http://gallery.rcpp.org/articles/getting-attributes-for-xts-example/

| - Convert `Rcpp::Matrix<RTYPE>` instance to xts object with given
| index(`DatetimeVector`)

I think for that one most often calls back to R to invoke 'as.xts()'. 
Eg that is what Rcpp itself does to create a dataframe.
 
| I have implemented these features, so I only need a skeleton of
| Rcpp-like package. Could you give me some suggestion about this?

You can just use any odd package generator -- eg Rcpp.package.skeleton() --
or copy and alter an existing package.

But out of curioisty, I went the other way to day today and played a little with
a basic RcppXts package to see if we could get to the exported functions of
the xts API.  There are fewer than the help(xtsAPI) shows -- what really
counts is its src/init.c.  If commmitted this to R-Forge as RcppXts_0.0.1 and
the basic work for me on Ubuntu. But between 32 and 64 bit Windows devel and
release, one fails cosistently (64 bit r-release). 

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com  
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to