Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Dirk Eddelbuettel
On 31 March 2013 at 22:47, Andre Mikulec wrote: | Thats good for right now. Yes. Your earlier mistake was to assume that you could do R CMD SHLIB on a file containing Rcpp and RcppArmadillo. And you cannot -- as one needs -I setting for includes, -L for libraries for Rcpp, for RcppArmadillo, et

Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Andre Mikulec
All, OS: Microsoft Windows XP SP3 32 bit compiler: gcc version 4.6.3 20111208 (prerelease) (GCC)   ( from Rtools folder ) RcppArmadillo : Version: 0.3.800.1 Rcpp: Version: 0.10.3 > library(RcppArmadillo) > RcppArmadillo.package.skeleton("testpackage") Creating directories ... Creating DESCRIPTION

Re: [Rcpp-devel] Admin: add reply-to headers?

2013-03-31 Thread Dirk Eddelbuettel
On 31 March 2013 at 14:07, Steve Lianoglou wrote: | Hi Darren, | | On Sat, Mar 30, 2013 at 10:10 PM, Darren Cook wrote: | | For this mailing list, hitting the Reply button (in Thunderbird) goes to | the sender. | | In many other lists hitting reply goes to the list.(*) The differen

Re: [Rcpp-devel] Admin: add reply-to headers?

2013-03-31 Thread Steve Lianoglou
Hi Darren, On Sat, Mar 30, 2013 at 10:10 PM, Darren Cook wrote: > For this mailing list, hitting the Reply button (in Thunderbird) goes to > the sender. > > In many other lists hitting reply goes to the list.(*) The difference is > the addition of the Reply-To header. > You'll notice, however,

Re: [Rcpp-devel] DataFrame and passing by reference

2013-03-31 Thread stat quant
Thanks Kevin, This question came because when you do this // [[Rcpp::export]] DataFrame updateDFByValue(DataFrame df) { int N = df.nrows(); NumericVector newCol(N,1.); df["newCol"] = newCol; return(df); } The DataFrame is returned to R as a list, and building back another data.fra

Re: [Rcpp-devel] DataFrame and passing by reference

2013-03-31 Thread Kevin Ushey
I think the problem here is that the assignment df["newCol"] = newCol copies the dataframe. Note that something like this would work as expected: #include using namespace Rcpp; // [[Rcpp::export]] void updateDFByRef(DataFrame& df) { int N = df.nrows(); NumericVector newCol(N,1.); df[

Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Dirk Eddelbuettel
Andre, Not reproducible, and you didn't tell us - what OS and version - what compiler and version - what Rcpp version - what RcppArmadillo version etc pp. Try to redo the following at your end: R> setwd("/tmp") R> library(RcppArmadillo) R> RcppArmadillo.package.skeleton("testp

[Rcpp-devel] DataFrame and passing by reference

2013-03-31 Thread stat quant
Hello list, looking at Rcpp::DataFrame in the galleryI realized that I didn't know how to modify a DataFrame by reference. Googling a bit I found this post on SO

Re: [Rcpp-devel] Datetime substraction bug ?

2013-03-31 Thread stat quant
Hello Dirk, no excitement at all, very simple it is. We were merely pinpointing that this definition of "operator -" was very unintuitive, but hey, you wrote the code, your right to put it the way you want, I am very happy to have have the right to use it for free. Cheers 2013/3/31 Dirk Eddelbuet

Re: [Rcpp-devel] Datetime substraction bug ?

2013-03-31 Thread Dirk Eddelbuettel
I don't really understand all the excitement here. It's quick enough to define a function to do what you want, no? R> NewYear <- as.Date("2013-01-01") R> Easter <- Sys.Date() R> cppFunction('double ddiff(Date a, Date b) { return a - b; }') R> cppFunction('double ddiff2(Date a, Date b) { return

Re: [Rcpp-devel] Datetime substraction bug ?

2013-03-31 Thread stat quant
Thanks, agreed, "bug" can be replaced by "feature" here, though a surprisingly strange one as I never encountered such in any dateTime class. Good news is that operator < is implemented as I thought - bool operator<

Re: [Rcpp-devel] Datetime substraction bug ?

2013-03-31 Thread Robin Girard
Actually that's not a big trick date.getFractionalTimestamp() returns date.m_dt which is a double. The substraction on double is the "usual one" and date_end.getFractionalTimestamp()-date_begin.getFractionalTimestamp() gives a positive number if and only if date_end>date_begin. My only regre

Re: [Rcpp-devel] Datetime substraction bug ?

2013-03-31 Thread stat quant
Thanks a lot for reporting this I would surely have been caught (may be I am I'll go through code I wrote using this) by this bug. Posting your workaround would not hurt I think... Thanks and cheers 2013/3/30 Robin Girard > Thanks you're right I already wrote it myself with getFractional... >