Closed mynanshan closed 3 years ago
What version of rcmdcheck is this?
What version of rcmdcheck is this?
It is 1.3.3. I just found that there will be no problem after updating rcmdcheck
to the latest version. I should have tried this. Thanks.
Btw, it is just me or it is a common problem in the old version?
AFAIR it used to happen when you did not have a terminating newline in your R profile.
FWIW it always makes sense to have a terminating newline in code files, as the lack of it is a common source of bugs. E.g. R used to have bug that it did not evaluate a last line
in .Renviron
without a terminating newline. I believe that this is now fixed though.
I was copying and pasting the code in section 2.9 of the R package tutorial by Hadley Wickham and Jenny Bryan. When I executed the R CMD
check()
for the example packagefoofactors
, an error occurred:Then I started to debug through
rcmdcheck:::make_fake_profile
. I found that the process was trying to catenate my original ".Rprofile" located in "C:/User/Documents" with the definition of the function.Last
. A new temporary R profile was created, in which the text isAs you can see from the picture, there seems to lack a line break between the old
options(...)
and the.Last
function. After I delete theoptions(...)
from the R profile, thecheck()
will work successfully.Here's some of my system info: