Skip to content
Prev 529 / 12125 Next

[R-pkg-devel] S3 method, useMethod and <-, using Roxygen

Here's a minimal reprex:

out <- roc_proc_text(rd_roclet(), "
  #' Foo
  `foo<-` <- function(x, y, value) {
    UseMethod('set_labels<-')
  }

  #' Foo
  `foo<-.default` <- function(x, y, value) {
    x
  }
  ")[[2]]

cat(format(out))

That generates

\usage{
\method{foo}{default}(x, y) <- value
}

which I believe is correct, although I don't think I've ever seen such
a construct in the wild.

Duncan: does that look right to you? (i.e. is that what the usage of
method of a replacement function should look like?)

Hadley
On Fri, Oct 23, 2015 at 3:30 AM, Daniel L?decke <d.luedecke at uke.de> wrote: