Use Roxygen to make S3method in NAMESPACE

前端 未结 1 1538
天涯浪人
天涯浪人 2021-01-05 19:54

I want to export an S3method named [.myclass using roxygen2 and I can\'t see a clean way to do this.

I need NAMESPACE to have

S3method(\"[\",myclass)         


        
相关标签:
1条回答
  • 2021-01-05 20:42

    Answer:

    Hadley was incredibly helpful and now I realize that I shouldn't be using setMethodS3 but instead just

    #' @method [ myclass
    #' @export
    "[.myclass" <- function(x,i) { blah blah blah }
    

    and then everything works great.

    0 讨论(0)
提交回复
热议问题