title: Discrepancy between roxygen2 and building package
body: <p>I'm trying to build my own package, and I have all my codes in subdirectory pkg/R folder.<br>
  Inside my main_code.R, I refer to other codes by doing the following:</p>
  
  <pre><code>source("./R/code1.R")
  source("./R/code2.R")
  </code></pre>
  
  <p>These methods seem to fail when I try to build my package:</p>
  
  <pre><code>source("/R/code1.R")
  source("./code1.R")
  source("code1.R")
  ERROR: lazy loading failed for package 'pkg'
  </code></pre>
  
  <p>When I run roxygen2::roxygenise() after building the package, this is the error I get:</p>
  
  <pre><code>Error in file(filename, "r", encoding = encoding) : 
    cannot open the connection
  In addition: Warning messages:
  1: Version of roxygen2 last used with this package is 6.0.1.9000.  You only have version 6.0.1 
  2: In file(filename, "r", encoding = encoding) :
    cannot open file './R/code1.R': No such file or directory
  </code></pre>
  
  <p>I can seem to work around this problem if I set the working directory within main_code like this:</p>
  
  <pre><code>setwd("C:/Desktop/pkg")
  </code></pre>
  
  <p>However, I don't want to set the working directory within my package as I plan to run this on different computers. I can delete or comment setwd command when I deploy my package, but I feel like I'm missing something.   </p>
  
  <p>I read here <a href="https://github.com/STAT545-UBC/Discussion/issues/71" rel="nofollow noreferrer">https://github.com/STAT545-UBC/Discussion/issues/71</a> that you shouldn't need to make reference to your code if it's in the pkg/R folder, but my package fails to build if I neglect them. I also tried to add my codes as part of Collate in DESCRIPTION file, but that also failed to build.</p>
  
  <p>Could someone please point out what I'm missing here?</p>