Rd file name conflict when extending a S4 method of some other package

前端 未结 2 541
名媛妹妹
名媛妹妹 2021-01-01 08:31

Actual question

How do I avoid Rd file name conflicts when

  1. a S4 generic and its method(s) are not necessarily all defined in the sa
2条回答
  •  自闭症患者
    2021-01-01 08:55

    I managed to generate NAMESPACE and *.Rd files for S4 methods for generics defined in another package than mine.

    It took me the following steps:

    1. Create NAMESPACE by hand as a workaround to a known roxygen2 bug.

      Writing a NAMESPACE by hand is not so difficult at all!

      Switch off NAMESPACE generation by roxygen2 in RStudio:

      Build > more > Configure build tools > configure roxygen > do not use roxygen2 to generate NAMESPACE.
      
    2. import the package containing the generic and export the S4 methods using exportMethods.

    3. Write separate roxygen2 documentation for each of the S4 methods. Do not combine roxygen2 documentation (as I generally do for different methods of the same generic).

    4. Add explicit roxygen tags @title and @description to the roxygen documentation of the S4 methods. Write @description explicitly, even if its value is identical as @title.

    That makes it work for me.

提交回复
热议问题