On 17 November 2012 at 16:18, baptiste auguie wrote:
| I've tested my package with the latest Rcpp svn commit (3987) on r-forge and
| that fixes it. I'm therefore keen to just wait for the next Rcpp release; I'll
| write the CRAN maintainers to see what they want to do with temporarily broken
| cd
I've tested my package with the latest Rcpp svn commit (3987) on r-forge
and that fixes it. I'm therefore keen to just wait for the next Rcpp
release; I'll write the CRAN maintainers to see what they want to do with
temporarily broken cda in the meantime.
Thanks again for the very responsive help,
On 16 November 2012 at 23:28, Søren Højsgaard wrote:
| Dear list,
|
| Sorry for a trivial question: I have created the function below which calls
"match" on each vector in a list and returns the result as a list. The function
does what I want it to, but I am puzzled by this:
|
| + IntegerVecto
On 17 November 2012 at 01:06, Romain Francois wrote:
|
| Le 17/11/12 00:59, baptiste auguie a écrit :
| > I see, thanks a lot for tracking this down.
Seconded -- nicely done.
| > In practical terms, should I change all such functions to use SEXP +
| > explicit wrap, or will you submit a new CRA
Le 17/11/12 00:59, baptiste auguie a écrit :
I see, thanks a lot for tracking this down.
In practical terms, should I change all such functions to use SEXP +
explicit wrap, or will you submit a new CRAN version soon enough fixing
this?
I don't know.
Personally I don't mind waiting a bit for
I see, thanks a lot for tracking this down.
In practical terms, should I change all such functions to use SEXP +
explicit wrap, or will you submit a new CRAN version soon enough fixing
this? Personally I don't mind waiting a bit for the CRAN fix of cda;
probably noone else uses my package and I'd r
This is about one of C++ most annoying things. order of includes.
To make it short, the function that is responsible for making an R
object out of the returned arma::mat is module_wrap, which calls wrap,
Where module_wrap is currently written, it does not "see" the wrap()
overloads from Rcppp
This is not implemented. You can use Rf_PrintValue( out ) which prints
just like R's print.
Le 17/11/12 00:28, Søren Højsgaard a écrit :
Dear list,
Sorry for a trivial question: I have created the function below which calls
"match" on each vector in a list and returns the result as a list. Th
Dear list,
Sorry for a trivial question: I have created the function below which calls
"match" on each vector in a list and returns the result as a list. The function
does what I want it to, but I am puzzled by this:
+ IntegerVector out = R_match(wrap(ee), V_);
+ Rcout << out << std::endl;
whi
On 17 November 2012 at 11:31, baptiste auguie wrote:
| Hi,
|
| (Hopefully this makes it to the list; I believe I've had problems reaching it
| because of a recent change between @gmail and @googlemail).
Looks like it.
| I made a minimal package * to illustrate the problem of my recently broken
Le 16/11/12 23:51, baptiste auguie a écrit :
Hi Romain, Dirk, all,
Thanks for the quick replies. I think the list problem was due to a
change in my gmail address (from "googlemail"); still puzzling that I
didn't get a warning.
Hopefully someone can figure out why a function that returned an arm
Hi Romain, Dirk, all,
Thanks for the quick replies. I think the list problem was due to a change
in my gmail address (from "googlemail"); still puzzling that I didn't get a
warning.
Hopefully someone can figure out why a function that returned an arma
matrix has now become a vector: I've posted a
First time I see this email.
Sorry your package does not work.
R CMD check --no-vignettes worked. (this is how I tested), but indeed
something in the vignette makes it crash. I guess I should check the
vignettes too :/
I get an error in demo(dimer_linear)
regarding something that does not l
Le 16/11/12 18:03, Hadley Wickham a écrit :
Ouch. Simon wins:
expr minlqmedianuq max
1 fmatch(xx, letters) 59.4727 60.29989 74.18049 77.94288 112.2938
2 match__(xx, letters) 137.3878 137.77486 138.33766 152.14018 193.3748
3 match_(xx, letter
I've tried to be better about const-ness in revision 3986. Please keep
investigating.
Thanks.
Romain
Le 16/11/12 19:53, Ramon Diaz-Uriarte a écrit :
More on const arguments:
the first will compile and work, the second will not compile, even if we
do not modify anything. As far as I can tell
More on const arguments:
the first will compile and work, the second will not compile, even if we
do not modify anything. As far as I can tell, in this case the culprit is
related to having the reference to the Column, because f3 does compile and
work.
I guess the problem is the "*this", returne
Wow, that was terrible. Once again, now proofread and edited.
On 16 November 2012 at 08:50, JJ Allaire wrote:
| Anyhow, I think I am probably missing some linking info from my
| inlinePlugIn statement.
|
|
| This is the key -- plugins that do linking are much more complicated than ones
On 16 November 2012 at 08:50, JJ Allaire wrote:
| Anyhow, I think I am probably missing some linking info from my
| inlinePlugIn statement.
|
|
| This is the key -- plugins that do linking are much more complicated than ones
| that rely on headers only. You can look at the Rcpp and RcppG
> Ouch. Simon wins:
>
> expr minlqmedianuq max
> 1 fmatch(xx, letters) 59.4727 60.29989 74.18049 77.94288 112.2938
> 2 match__(xx, letters) 137.3878 137.77486 138.33766 152.14018 193.3748
> 3 match_(xx, letters) 147.7115 148.36442 149.20221 162.
>
> Anyhow, I think I am probably missing some linking info from my
> inlinePlugIn statement.
>
This is the key -- plugins that do linking are much more complicated than
ones that rely on headers only. You can look at the Rcpp and RcppGSL
packages as examples -- in short there needs to be a functi
Hi All,
I'm attempting to get inline up and running for my package, but am having some
trouble. My plug in statement is:
inlineErnmPlugin <- Rcpp:::Rcpp.plugin.maker(
include.before = "#include ",
libs = "",
package= "ernm"
)
T
Le 16/11/12 16:52, Dirk Eddelbuettel a écrit :
On 16 November 2012 at 09:36, Hadley Wickham wrote:
| > | I've been using (e.g.) http://www.cplusplus.com/reference/stl/map/ a
| > | lot - it has plenty of examples, which is really helpful for getting
| > | started.
| >
| > It seems that site has a
On 16 November 2012 at 09:36, Hadley Wickham wrote:
| > | I've been using (e.g.) http://www.cplusplus.com/reference/stl/map/ a
| > | lot - it has plenty of examples, which is really helpful for getting
| > | started.
| >
| > It seems that site has a bit of an uncool reputation among the cognoscent
> | I've been using (e.g.) http://www.cplusplus.com/reference/stl/map/ a
> | lot - it has plenty of examples, which is really helpful for getting
> | started.
>
> It seems that site has a bit of an uncool reputation among the cognoscenti on
> SO.
So you're saying it's good? ;)
> I usually go bac
> You might like to di something like:
>
> std::vector< std::vector > groups( max(i) ) ;
>
> you'll pay for the traversal of the max, but then you don't need to resize.
I ended up going with:
NumericVector tapply3(NumericVector x, IntegerVector i, Function fun) {
std::map > groups;
NumericVe
On 16 November 2012 at 09:22, Hadley Wickham wrote:
| > | Cool - thanks! It might be useful in general to expose some of the
| > | STL sorted range commands - I'm not sure if that's general enough for
| > | base Rcpp or not.
| >
| > Even having really good documentation on all the STL goodness wo
That's the one;
You might like to di something like:
std::vector< std::vector > groups( max(i) ) ;
you'll pay for the traversal of the max, but then you don't need to resize.
Calling fun() is going to be costly too (probably what will dominate).
specially because of our internal::try_catch
> | Cool - thanks! It might be useful in general to expose some of the
> | STL sorted range commands - I'm not sure if that's general enough for
> | base Rcpp or not.
>
> Even having really good documentation on all the STL goodness would be good.
> There is an entire chapter in (free, pdf and oth
On 16 November 2012 at 06:54, Hadley Wickham wrote:
| Cool - thanks! It might be useful in general to expose some of the
| STL sorted range commands - I'm not sure if that's general enough for
| base Rcpp or not.
Even having really good documentation on all the STL goodness would be good.
There
Ooops, I completely misinterpreted the std::vector API. To insert the
elements I need to do:
for(x_it = x.begin(), i_it = i.begin(); x_it != x.end(); ++x_it, ++i_it) {
int i = *i_it;
if (i > groups.size()) {
groups.resize(i);
}
groups[i - 1].push_back(*x_it);
}
Hadley
Hi all,
I'm attempting to write a simple version of tapply in C++ (see
attached). However, when I run tapply2(1, 1, sum) (which should
return 1), R segfaults. If I run R with gdb, I get the following
stack trace:
#0 0x03942120 in tapply2 (x=@0xbfffda68, i=@0xbfffda58,
fun=@0xbfffda50) at tappl
Dear All,
I thought something like this would fail (would not compile):
// [[Rcpp::export]]
double changeAVector(const NumericVector a) {
a[0] = 3.0;
return 44.0;
}
But it does compile OK, and it really does modify the argument:
d1 <- c(93, 99); changeAVector(d1); d1
Is this expected
>> I guess we could come up with a nicer syntax for these, maybe static
>> functions in Vector<> so that we could do :
>>
>> IntegerVector::is_na( )
>> NumericVector::get_na( )
>> ...
>
>
> commmited in rev 3979.
I don't want to flog a dead horse, but one of the things I like about
github is how e
Le 16/11/12 14:00, Hadley Wickham a écrit :
On Fri, Nov 16, 2012 at 2:25 AM, Romain Francois
wrote:
Thanks for exploring these issue. This looks very useful.
I get:
str( first_log(NA) )
logi TRUE
str( first_int(NA_integer_) )
int NA
str( first_num(NA_real_) )
num NA
str( first_ch
On Fri, Nov 16, 2012 at 2:25 AM, Romain Francois
wrote:
> Thanks for exploring these issue. This looks very useful.
>
> I get:
>
>> str( first_log(NA) )
> logi TRUE
>> str( first_int(NA_integer_) )
> int NA
>> str( first_num(NA_real_) )
> num NA
>> str( first_char(NA_character_) )
> chr "NA"
>
> I've commited an initial version of setdiff.
Cool - thanks! It might be useful in general to expose some of the
STL sorted range commands - I'm not sure if that's general enough for
base Rcpp or not.
> There is room for improvement given the R version:
>
>> setdiff
> function (x, y)
> {
>
> I agree that we might want to have these things in a package say RcppBase.
> Then Rcpp can remain the R to cpp layer. And anybody who want to implement
> an R base function in cpp, can contribute it to RcppBase.
Sounds like a good idea, except for the naming (which makes it sound
like the Rcpp b
Thanks for exploring these issue. This looks very useful.
I get:
> str( first_log(NA) )
logi TRUE
> str( first_int(NA_integer_) )
int NA
> str( first_num(NA_real_) )
num NA
> str( first_char(NA_character_) )
chr "NA"
For first_log: a bool can either be true or false. In R logical vectors
I agree that we might want to have these things in a package say RcppBase.
Then Rcpp can remain the R to cpp layer. And anybody who want to implement
an R base function in cpp, can contribute it to RcppBase.
Willem
On Fri, Nov 16, 2012 at 8:56 AM, Romain Francois
wrote:
> We need to fond the ri
39 matches
Mail list logo