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 Eddelbuettel <[email protected]> > > 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 b - a; }') > R> ddiff(NewYear, Easter) > [1] 89 ## I find this more logical > R> ddiff2(NewYear, Easter) > [1] -89 ## closer to R's difftime and 'odd' to me > R> > > Dirk > > -- > Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com >
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
