[Rcpp-devel] Using Rcpp in a package only as an option?

Tal Galili tal.galili at gmail.com
Fri Aug 16 18:53:55 CEST 2013


I suspected that this is the case.
Will do - thanks.




----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------



On Fri, Aug 16, 2013 at 7:52 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 16 August 2013 at 19:36, Tal Galili wrote:
> | Hello dear list members,
> |
> | Following previous correspondence, I wish to use an Rcpp function inside
> a
> | package I'm authoring.
> | However, I do not wish to force the user to install Rcpp, and if he does
> not
> | wish to do so, I want to let him "fall back" on an R written function
> (which is
> | 20-40 times slower, but it works).
> | Looking at this Vignettes:
> | http://cran.rstudio.com/web/packages/Rcpp/vignettes/Rcpp-package.pdf
> | I see that including Rcpp in a package require the use of "depends" in
> | DESCRIPTION.
> | Is there a way to have Rcpp as "Suggests", and to later use "require"
> when
> | loading the package, to decide if to load the Rcpp function or the R
> function?
> | (alternatively, I could have a separate package only for that function,
> but
> | that feels a bit like a "hack" to me)
>
> If the code is used (ie not commented out) then it must be compiled and
> linked and you must have the depends.
>
> Your only choice may be to author two packages  'foo'  and   'fooFast'
> where only the latter uses Rcpp.
>
> Dirk
>
> | Thoughts?
> |
> | With regards,
> | Tal
> |
> |
> |
> |
> |
> | ----------------Contact
> | Details:-------------------------------------------------------
> | Contact me: Tal.Galili at gmail.com |
> | Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> | www.r-statistics.com (English)
> |
> ----------------------------------------------------------------------------------------------
> |
> |
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130816/871eccc6/attachment.html>


More information about the Rcpp-devel mailing list