Re: [Rcpp-devel] Can I use inline-Rcpp in the package?

2012-03-28 Thread Dirk Eddelbuettel
On 28 March 2012 at 14:51, Seungki Kim wrote: | Hi, | | How can I compile inline-Rcpp in the package? You can, but we think you should not. See the Rcpp-FAQ vignette for more. | I have made a package with Rcpp.package.skeleton("abcd"), and added a | ".R" including inline-Rcpp. The two are ort

[Rcpp-devel] Can I use inline-Rcpp in the package?

2012-03-28 Thread Seungki Kim
Hi, How can I compile inline-Rcpp in the package? I have made a package with Rcpp.package.skeleton("abcd"), and added a ".R" including inline-Rcpp. And it can be packaged and installed well with R CMD build, check and INSTALL. I loaded it with library(abcd) command, and called the function define

Re: [Rcpp-devel] (OS X / 64 bit woes?) R CMD check failing on skeletonc Rcpp module

2012-03-28 Thread Dirk Eddelbuettel
Just to bring a little bit of closure to this: I circled back with Bob, and this appears to be a local issue with the machine in question as the simple test of "build a skeleton package using Modules" leads to a buildable package on another machine. Dirk -- R/Finance 2012 Conference on May 11 a

[Rcpp-devel] [ANN] RcppArmadillo 0.2.38 at R-Forge

2012-03-28 Thread Dirk Eddelbuettel
Conrad released 2.99.2 of Armadillo; this just became RcppArmadillo 0.2.38. As with 0.2.37 from last week, this is not on CRAN (and more about that at http://dirk.eddelbuettel.com/blog/) Once R-Forge updates (which is nightly, I think), you can do install.packages("RcppArmadillo", repos="http:

Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Dirk Eddelbuettel
On 28 March 2012 at 16:36, Jonas Rauch wrote: | If I remember correctly, environments use hash tables to lookup names. | | In pure R to check if an element L[["key"]] exists I would usually use | > "key" %in% names(L) | which seems to be reasonably fast. `%in%` works in vectors, too | > keys %in%

Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Jonas Rauch
If I remember correctly, environments use hash tables to lookup names. In pure R to check if an element L[["key"]] exists I would usually use > "key" %in% names(L) which seems to be reasonably fast. `%in%` works in vectors, too > keys %in% L returning exactly what Dirks suggestion was supposed to

Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Dirk Eddelbuettel
On 28 March 2012 at 15:17, Ulrich Bodenhofer wrote: | Thanks for your swift reply, Dirk! Wow, to be frank, that is not what I | was expecting. In the meantime, I read Section 5.9.6 of "Writing R | extensions" and I was stunned to see a solution there that is similar to | the one you propose. I

Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Ulrich Bodenhofer
Thanks for your swift reply, Dirk! Wow, to be frank, that is not what I was expecting. In the meantime, I read Section 5.9.6 of "Writing R extensions" and I was stunned to see a solution there that is similar to the one you propose. I do not know R internals very well, but I cannot believe that

Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Dirk Eddelbuettel
On 28 March 2012 at 13:56, Ulrich Bodenhofer wrote: | My question is the following: is there any way of checking in whether a | component of an Rcpp list (or vector) with a given name exists in this list. If | I simply try accessing a non-existing component, I get an "index out of bounds" | erro

[Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Ulrich Bodenhofer
Hi, My question is the following: is there any way of checking in whether a component of an Rcpp list (or vector) with a given name exists in this list. If I simply try accessing a non-existing component, I get an "index out of bounds" error. Trying to catch a possible exception did not work