[Rcpp-devel] overloaded method problem is fixed.

2014-08-28 Thread Chaomei Lo
I am sending this again, cause when I forward to rcpp-devel, the gmail put the previous message first. Not expect to fix the problem this easy. I just get a chance to look into the "Module_generated_method.h" code and Romain left a "const char *" before the valid method. So here below is the fix.

[Rcpp-devel] Fwd: overloaded methods

2014-08-28 Thread Chaomei Lo
mizer::get) ) ; } Thanks. -- Forwarded message -- From: Chaomei Lo Date: Wed, Aug 27, 2014 at 10:17 AM Subject: overloaded methods To: "rcpp-devel@lists.r-forge.r-project.org" < rcpp-devel@lists.r-forge.r-project.org> Sorry to bug you all, I accidently sent a wr

[Rcpp-devel] overloaded methods

2014-08-27 Thread Chaomei Lo
Sorry to bug you all, I accidently sent a wrong message few minutes ago. I have posted this problem few days ago, can anybody helps me with this compilation error ? I do not have idea why there is no matching function... It is from Romain's example - http://lists.r-forge.r-project.org/pipermail/rc

[Rcpp-devel] Fwd: Compilation errors on overloaded methods in modules - one with dispatch based on the arguments

2014-08-27 Thread Chaomei Lo
ector (Randomizer::*)(int) )(&Randomizer::get) , &get_int_valid ) .method( "get" , ( List (Randomizer::*)(IntegerVector) )(&Randomizer::get) ) ; } ------ Forwarded message -- From: Chaomei Lo Date: Sat, Aug 23, 2014 at 12:51 PM Su

[Rcpp-devel] Compilation errors on overloaded methods in modules - one with dispatch based on the arguments

2014-08-23 Thread Chaomei Lo
Hi, Romain, I have created overloaded methods have argument types like blow. fn(List) fn(List, NumericMatrix) fn(List, DataFrame) The first function works fine, and adding the second one with different number of arguments works fine too. With the third one added, it compiled fine but when I invo

Re: [Rcpp-devel] retrieve the column names of Rcpp::DataFrame

2014-07-10 Thread Chaomei Lo
> Cheers, > Kevin > > > On Thu, Jul 10, 2014 at 5:09 PM, Chaomei Lo wrote: > >> I have a R data frame pass to the Rcpp function, for example in below- >> >> void myDataFrame(Rcpp::DataFrame df) { >> >> } >> >> I would need to know t

[Rcpp-devel] retrieve the column names of Rcpp::DataFrame

2014-07-10 Thread Chaomei Lo
I have a R data frame pass to the Rcpp function, for example in below- void myDataFrame(Rcpp::DataFrame df) { } I would need to know the column names first before I retrieve the data but df.colnames() does not work but the df.length() and df.nrows() work. Thanks for help ! Chaomei _

[Rcpp-devel] Fwd: package contains overloaded methods in module

2014-07-08 Thread Chaomei Lo
Cpp) directive to NAMESPACE >> copied /people/d3j508/Wyoming/test_module.cpp to src directory >> added example src file using Rcpp attributes >> compiled Rcpp attributes >> added Rd file for rcpp_hello_world >> copied the example module file Thanks a lot. C

[Rcpp-devel] Fwd: package contains overloaded methods in module

2014-07-08 Thread Chaomei Lo
Hi, Romain, Please see my previous message in below. When I created a package, the RcppExports.cpp did not contain any info about the class "Randomizer". Would you please give a advice ? Thanks in advance. Chaomei -- Forwarded message ------ From: Chaomei Lo Date: Tue, J

[Rcpp-devel] package contains overloaded methods in module

2014-07-01 Thread Chaomei Lo
I use Romain's example as follows (after /// line). It works fine with the sourceCpp(..). However, with the package I created, it loaded fine but I got this error below when I instantiate the class. -Thanks for help. > library("testModule", lib.loc="/people/me/.Rlibs") > r <- new( Randomizer ) E

Re: [Rcpp-devel] type information about elements in Rcpp::List

2014-06-09 Thread Chaomei Lo
Hi, Romain, Thanks a lot for the quick reply !! Suffix with << L >> works for me for both Rf_isInteger and is. On Mon, Jun 9, 2014 at 12:43 PM, Romain François wrote: > > Le 9 juin 2014 à 21:40, Chaomei Lo a écrit : > > > > > I have a R list something lik

Re: [Rcpp-devel] type information about elements in Rcpp::List

2014-06-09 Thread Chaomei Lo
I have a R list something like this - op=list(a=200, b="test", c=4.5) when I pass it as an argument to Rcp Export function which the code looks like this in below. int n = xlist.length(); for (int I=0; I < n; I++) { SEXP s = xlist[I]; if (Rf_isInteger(

Re: [Rcpp-devel] Not able to convert from Rcpp::NumericVector to Teuchos::ArrayRCP

2014-05-23 Thread Chaomei Lo
geExporter< Teuchos::ArrayRCP >{ > public: > Exporter( SEXP x) : RangeExporter< Teuchos::ArrayRCP >(x){} > } > > } > } > > > Romain > > Le 23 mai 2014 à 00:42, Chaomei Lo a écrit : > > Sorry to confuse you, Dirk, I had my previous message ti

[Rcpp-devel] Not able to convert from Rcpp::NumericVector to Teuchos::ArrayRCP

2014-05-22 Thread Chaomei Lo
Sorry to confuse you, Dirk, I had my previous message title wrong. Here below was the message with the correct title and content. I have created R packages using Makevars and it works pretty good for me. I am able to convert from a Rcpp::NumericVector to std::vect

[Rcpp-devel] file name changed in package

2014-05-22 Thread Chaomei Lo
Hi, Dirk, I have created R packages using Makevars and it works pretty good for me. I am able to convert from a Rcpp::NumericVector to std::vector as in below. *NumericVector col_cts = buildMatrix(Xr);vector col_counts = Rcpp::as>(col_cts); * Now I am having a problem with an application invo

[Rcpp-devel] PKG_CPPFLAGS and PKG_LIBS not being picked for compilation

2014-04-23 Thread Chaomei Lo
Hi, Dirk, I am testing the TRNG (Random number generation) using Rcpp, but it seems like the PKG_CPPFLAGS and PKG_LIBS not being picked for compilation and creating shared library. I invoked the R shell right above the “trng”. > getwd() [1] "/people/mei/trng-4.15" > library(Rcpp) > Sys.se