<div dir="ltr">I suspected that this is the case.<div>Will do - thanks.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><br>----------------Contact Details:-------------------------------------------------------<br>

Contact me: <a href="mailto:Tal.Galili@gmail.com" target="_blank">Tal.Galili@gmail.com</a> |  <br>Read me: <a href="http://www.talgalili.com" target="_blank">www.talgalili.com</a> (Hebrew) | <a href="http://www.biostatistics.co.il" target="_blank">www.biostatistics.co.il</a> (Hebrew) | <a href="http://www.r-statistics.com" target="_blank">www.r-statistics.com</a> (English)<br>

----------------------------------------------------------------------------------------------<br><br></div></div>
<br><br><div class="gmail_quote">On Fri, Aug 16, 2013 at 7:52 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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