Error with automated checking

I've just started getting the following result from devtools::check(), and I'm not even sure how to interpret it:

Setting env vars:
* _R_CHECK_CRAN_INCOMING_USE_ASPELL_: TRUE
* _R_CHECK_CRAN_INCOMING_REMOTE_    : FALSE
* _R_CHECK_CRAN_INCOMING_           : FALSE
* _R_CHECK_FORCE_SUGGESTS_          : FALSE
-- R CMD check -----------------------------------------------------------------
   Error: 4:2: unexpected symbol
   3:     suppressMessages(require(testthat))
   4: }.Last
       ^
   Execution halted

It nonetheless finishes immediately afterwards with:

Duration: 208ms

0 errors v | 0 warnings v | 0 notes v

R CMD check succeeded

Does anyone have advice for how to start tracking down the issue?

1 Like

A few follow-up questions to help you troubleshoot the issue:

  1. Are you able to build the package with devtools::build()?
  2. What happens when you test the package with devtools::test()?
  3. What file contains the line suppressMessages(require(testthat))? You can search the entire package in RStudio with Edit->Find in Files... (Ctrl-Shift-F). Can you share the contents of that file?
1 Like

Thanks for the help.

  1. Yes.
  2. It passes all tests with complete execution.
  3. No file in the package contains that line of code.
1 Like

Perhaps it is in your project or user level level .Rprofile?

2 Likes

OK, even stranger, my user .Rprofile file in its entirety:

if (interactive()) {
    suppressMessages(require(devtools))
    suppressMessages(require(testthat))
}

There is no .Last.

1 Like

OK, I have the cause and the solution:

When I ran use_devtools() and copied the text over to .Rprofile, the text terminated without a carriage return. The solution was to simply add said carriage return to the end of the file.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.