Re: [Rcpp-devel] How to give default value with Rcpp and roxygen2 involving seq_len

2016-01-13 Thread Dirk Eddelbuettel
On 13 January 2016 at 16:41, Lafaye de Micheaux Pierre wrote: | Hello everybody, | | Let's consider the simple function: | | f <- function(x = 1:10) {return(x)} | | where the argument 'x' could take non integer values. | | I would like to create such a function using Rcpp and roxygen2. If I tr

Re: [Rcpp-devel] How to give default value with Rcpp and roxygen2 involving seq_len

2016-01-13 Thread JJ Allaire
The parsing of default values for attributes has some significant limitations (it's mostly just use for literals and empty vectors). This is what is currently supported: • String literals delimited by quotes (e.g. "foo") • Decimal numeric values (e.g. 10 or 4.5) • Pre-defined constants including t

[Rcpp-devel] How to give default value with Rcpp and roxygen2 involving seq_len

2016-01-13 Thread Lafaye de Micheaux Pierre
Hello everybody, Let's consider the simple function: f <- function(x = 1:10) {return(x)} where the argument 'x' could take non integer values. I would like to create such a function using Rcpp and roxygen2. If I try something like: //' @param x Vector of real values NumericVector f(NumericVect

Re: [Rcpp-devel] Debugging an C++ code in package using Rcpp package ?

2016-01-13 Thread Dirk Eddelbuettel
Rainer, The old BioC video is very good, albeit somewhat low-level (which you cannot avoid with compiled code). Kevin's write-up is also very nice. There is also this older post by Doug Bates somewhere but all I find right now is this: http://comments.gmane.org/gmane.emacs.ess.general/4188 wh

Re: [Rcpp-devel] Debugging an C++ code in package using Rcpp package ?

2016-01-13 Thread Qiang Kou
Hi, Rainer, Personally I think the video below provides a very nice example to debug in R package. https://vimeo.com/11937905 Hope it helps. Best, KK On Wed, Jan 13, 2016 at 5:21 AM, Rich FitzJohn wrote: > On a mac, lldb passed to R as `R -d lldb` usually does the trick. Kevin > Ushey has

Re: [Rcpp-devel] Debugging an C++ code in package using Rcpp package ?

2016-01-13 Thread Rich FitzJohn
On a mac, lldb passed to R as `R -d lldb` usually does the trick. Kevin Ushey has written a nice article on this here: http://kevinushey.github.io/blog/2015/04/13/debugging-with-lldb/ which complements the information in R-exts https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Debugg

[Rcpp-devel] Debugging an C++ code in package using Rcpp package ?

2016-01-13 Thread Rainer M Krug
Hi What is te easiest way of debugging a package using Rcpp which gives a segfault in the C++ code? What is the up-to-date procedure? I am on OS X and use usually emacs and ess. Any suggestions? Thanks, Raner -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UC