rroxygen2

roxygen2 is processing too many files


I have used R roxygen2 on Linux for many years, on packages whose R directories have a mixture of .s files and .r files. The .s files do not use roxygen2 markup and the .r files do. roxygen2::roxygenize() only processed the .r files and all was well. Now on MacOS it is processing all files and throwing errors on the bad markup in the .s files. How do I return to the previous behavior? I'm using roxygen2 7.3.1.


Solution

  • You haven't posted anything reproducible, so any answer will be speculation. In a previous answer I speculated and I think I got it wrong, so I deleted that one. Here's my current thinking:

    You can't do what you are asking to do.

    You say that you did this previously on Linux, and blame the change on using a Mac; but I think there must be other important differences besides the OS. Roxygen probably has small platform-dependent differences, but I don't think there would be anything as big as what you describe.

    I guessed that you were talking about the Hmisc package, and tried it myself. I saw warnings like

    areg.s:432: S3 method `plot.areg` needs @export or @exportS3method tag.
    

    These warnings come when you ask roxygenize() to create the NAMESPACE file, and they are unavoidable. For plot.areg to be treated as an S3 method, it should be mentioned in NAMESPACE. In the Hmisc version I was looking at you had a hand-written NAMESPACE file that contained

    S3method(plot,areg)
    

    If you ask roxygenize() to create your NAMESPACE file, but you also ask it to ignore the areg.s file, how could it possibly know to add that line?

    So your only solutions are to add markup to your .s files, or to stop asking roxygenize() to create the NAMESPACE file. When I ran

    roxygenize(roclets = "rd")
    

    on Hmisc, everything was fine, and the hand-written NAMESPACE wasn't touched.