Re: [Rcpp-devel] Please help! A list containing dataframe

2013-09-27 Thread stat quant
This is not a Rcpp solution but be advise that as long as your function "ma" do not require values on previous lines, you might want to look at the data.table package. This package provides ultra fast operations on data.frames. Off course nothing prevents you from writing "ma" in C/C++ and to use d

Re: [Rcpp-devel] bug with DatetimeVector ?

2013-07-19 Thread stat quant
Just updated my R from 3.0.0 to 3.0.1... __the bug disappeared__ Sorry for the inconvenience ! 2013/7/19 stat quant > And I've been carefull to get a fresh session from R --vanilla so I have > no other package loaded and nothing from my Rprofile exectued, so I am a &g

Re: [Rcpp-devel] bug with DatetimeVector ?

2013-07-19 Thread stat quant
Dirk, that's strange but your code crases on my box too... The only thing out of the ordinary might be that mt R is 3.0.0 and when I load Rcpp I get "le package ‘Rcpp’ a été compilé avec la version R 3.0.1 " Regards 2013/7/19 stat quant > Right 2 lines were missing: >

Re: [Rcpp-devel] bug with DatetimeVector ?

2013-07-19 Thread stat quant
70-01-01')) print(df) bug(df) ##here R crashes## 2013/7/19 Dirk Eddelbuettel > > On 19 July 2013 at 14:05, stat quant wrote: > | Hello list, I might have found a bug, would you mind checking it too? > > No, you didn't. See below. > > | In R: > | > | librar

[Rcpp-devel] bug with DatetimeVector ?

2013-07-19 Thread stat quant
Hello list, I might have found a bug, would you mind checking it too? In R: library("Rcpp") sourceCpp("rcpp.cpp") df = data.frame(x=c(1L,NA,2L), dt=as.POSIXct(c(1L,NA,2L),origin='1970-01-01')) df x dt 1 1 1970-01-01 00:00:01 2 NA 3 2 1970-01-01 00:00:02 In

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

2013-03-31 Thread stat quant
nters to the new list (not sure the best way to do this in > Rcpp), > 3) Assign the vector you want to the new, last column, > 4) Return that new list. > > This should work since internally, lists (VECSXP)s are just vectors of > SEXPs (pointers) to other R vectors (REALSXPs,

[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 stat quant
nnot be changed now, otherwise it will > become a bug for them... > > at the end a "bug" is only a missinterpretation of something somewhere ? :) > > lots of .getFractionalTimestamp() everywhere for me ... > R. > > > - Mail original - > De: "stat

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... >

[Rcpp-devel] Can I fill a matrix row by row with std (or similar)

2013-03-01 Thread stat quant
Hello list, I have several std::vector in a STL container and would like to fill a Rcpp::NumericMatrix row by row with them, is there an easy way to do it, or should I iterate over all elements as in usual C++? I saw the `_` in this post on SO but I think it has a different purpose. cCode <- '