R Calling internal function from an exported function inside package
<p>I am creating an R package in RStudio. Say I have two functions <code>fnbig()</code> and <code>fnsmall()</code> in my package named <code>foo</code>. <code>fnbig()</code> is a function that must be accessible to the user using the package. <code>fnsmall()</code> is an internal function that must not accessible to the user but should be accessible inside of <code>fnbig()</code>.</p>

<pre><code># package code
fnsmall &lt;- function()
{
bla bla..
}

#' @export
fnbig &lt;- function()
{
bla bla..
x &lt;- fnsmall()
bla..
}
</code></pre>

<p>I have tried exporting <code>fnsmall()</code>. All works but it litters the NAMESPACE. I tried not exporting <code>fnsmall()</code>, but then it doesn't work inside <code>fnbig()</code> when using <code>x &lt;- fnsmall()</code> or <code>x &lt;- foo::fnsmall()</code>. Then I tried to use <code>x &lt;- foo:::fnsmall()</code>, and it works. But I read that using <code>:::</code>is not recommended.</p>

<p>What is the best way to go about doing this? How do I call an internal function from an exported function?</p>