title: Using load() to load data from an .RData file during a testthat test on travis
body: <p>I'm using the <code>testthat</code> package to run unit tests with an R package I'm developing. I've run into a weird situation that I can't quite figure out what I'm doing wrong.</p>
  
  <p>I'm trying to load some test data (stored in dataframes) and some precomputed answers (again, stored in dataframes) to test some functions and compare the results. I've saved both sets of data as .Rdata files (in the tests/testthat/ directory), and I'm loading them in before I run the tests with <code>load(file.path('filename.RData'))</code></p>
  
  <p>When I run the tests on my computer, the tests run fine. But when they run on travis, I get the error: </p>
  
  <pre><code>&gt; test_check("mocapGrip")
    Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
    Calls: test_check ... force -&gt; source_file -&gt; eval -&gt; eval -&gt; load -&gt; readChar
    In addition: Warning message:
    In readChar(con, 5L, useBytes = TRUE) :
      cannot open compressed file 'extractedMarkerData.Rdata', probable reason 'No such file or directory'
  </code></pre>
  
  <p>I'm surely missing something very simple, but I've tried all of the obvious things (specifying relative paths from the start of the directory, etc.) Does anyone have any ideas on how to get travis to be able to load these files?</p>
  
  <p>Here's the contents of the offending testthat file:</p>
  
  <pre class="lang-r prettyprint-override"><code>library(mocapGrip)
  context("distance calculationss")
  
  load(file.path('extractedMarkerData.Rdata')) # markerDataHead
  load(file.path('dist57.RData')) # dist57head
  load(file.path('meanData.Rdata')) # meanDataHead
  
  test_that("calculateDistances returns the correct distances", {
    expect_equal(mocapGrip:::calculateDistances(markerDataHead, c(5,7)), dist57head)
  })
  
  test_that("meanOnAxis returns the correct distances", {
    expect_equal(mocapGrip:::meanOnAxis(markerDataHead, c(0, 1, 2, 3, 4), axis ="Y"), meanDataHead)
  })
  </code></pre>