title: Include library calls in functions?
body: <p>Is it good practice to include every library I need to execute a function within that function?</p>
  
  <p>For example, my file <code>global.r</code> contains several functions I need for a shiny app. Currently I have all needed packages at the top of the file. When I'm switching projects/copying these functions I have to load the packages/include them in the new code. Otherwise all needed packages are contained in that function. Of course I have to check all functions with a new R session, but I think this could help in the long run.</p>
  
  <p>When I tried to load a package twice it won't load the package again but checks it's already loaded. My main question is if it would slow my functions if I restructure in that way?</p>
  
  <p>I only saw that practice once, library calls inside functions, so I'm not sure.</p>