Ok, this might be a Roxygene issue, so I would close this discussion
here and file an issue at GitHub for further investigation. What I found
out so far:
#' @rdname set_label
#' @export
`set_label<-` <- function(x, attr.string = NULL, value) {
UseMethod("set_label<-")
}
#' @rdname set_label
> which I believe is correct, although I don't think I've ever seen such
> a construct in the wild.
What would be the proper way to define such methods?
Eg, I want `set_label` to work like this:
x <- set_label(x, "my label")
and additionally, like this:
set_label(x) <- "my label"
How would I
Ok, this seems to work!
Though I don't know why there's a warning, because in another function I
use @rdname as described before, which doesn't give a warning.
Best
Daniel
Am 23.10.2015 um 10:37 schrieb Kirill Müller:
values -> value is a typo in the implementation of .default(). I'm not
sur
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
}
Ok, the "Note" is due a typo (x <- set_labels(x, values,... "values"
should be "value").
But still after fixing this, the two warnings remain.
Am 23.10.2015 um 10:30 schrieb Daniel Lüdecke:
Hello,
I don't exactly know how to name my problem, so I try to describe it.
In my package (sjmisc), I
values -> value is a typo in the implementation of .default(). I'm not
sure you need to document the .default() function (the second @rdname
set_labels). If this doesn't help, you could try renaming set_labels()
to avoid collisions.
Best regards
Kirill
On 23.10.2015 10:30, Daniel Lüdecke w
Hello,
I don't exactly know how to name my problem, so I try to describe it.
In my package (sjmisc), I have a function to set label attributes to
vectors:
set_labels <- function(x, labels, ...) {
...
}
Usage would be:
x <- set_labels(x, c("lo", "high"))
No I wanted to also add functionality