Skip to content
Prev 5420 / 10988 Next

[Rcpp-devel] Regular Expressions

On Fri, Mar 1, 2013 at 8:56 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
I had no luck with sourceCpp or inline on Windows but did manage to
use R CMD SHLIB to build a dll which loads into 32-bit R (it does not
currently load in 64-bit R - haven't yet figured out why) and seems to
run ok there.  To get it to work I did replace the first and last
statements in regexDemo with these two respectively so that all inputs
and outputs are SEXPs:

    extern "C" SEXP regexDemo(SEXP ss) {
       std::vector<std::string> s = Rcpp::as<std::vector<std::string> >(ss);

    return Rcpp::wrap(Rcpp::DataFrame::create(Rcpp::Named("input") = s,
                                   Rcpp::Named("valid") = valid,
                                   Rcpp::Named("machine") = machine,
                                   Rcpp::Named("human") = human));

This isn't quite as nice as what you had but at least it runs.


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com