title: Building binary package R
body: <p>I am new to R and I am trying to make a standalone executable so that my scripts can be run without development tools. I have created multiple R scripts containing different functions and have been using a <code>main.r</code> script to connect the other scripts. I have been using RStudio and using Source on each file to add them to the Global Environment and finally using Source on my main file to start executing my program. When attempting to build a binary package through:</p>
  
  <pre><code>Build &gt; Build Binary Package
  </code></pre>
  
  <p>I was getting the error:</p>
  
  <pre><code>ERROR: The build directory does not contain a DESCRIPTION 
  file so cannot be built as a package.
  </code></pre>
  
  <p>So I created a package and now the error I get is </p>
  
  <pre><code>** preparing package for lazy loading
  Error in reorderPopulation(pop_fitness_list) : 
    could not find function "reorderPopulation"
  Error : unable to load R code in package 'EAtsp'
  ERROR: lazy loading failed for package 'EAtsp'
  * removing 'C:/Users/Ryan/AppData/Local/Temp/RtmpsXbv0j/temp_libpath27ec59515c59/EAtsp'
  Error: Command failed (1)
  Execution halted
  
  Exited with status 1.
  </code></pre>
  
  <p>Can someone explain to me how to fix this problem?</p>
  
  <p>EDIT: I have since added <code>roxygen</code> comments to each of my functions and they are all displaying within the <code>NAMESPACE</code> file but still have the same issue.</p>
  
  <p>These are the files my R directory contains:</p>
  
  <pre><code>fitness.r
  initDataset.r
  main.r
  operators.r
  selection.r
  </code></pre>
  
  <p>The functions within <code>fitness.r</code> can be found from <code>main.r</code> with no problem so I moved the <code>reorderPopulation</code> function which was previously in <code>selection.r</code> to <code>fitness.r</code> and it can be found. Why can the functions inside the <code>selection.r</code> file and possibly the others not be found?</p>