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
Beware that load_all attaches the entire package namespace to the search
path, so its effect is not consistent with actual usage of the package. I
think devtools has other functionality that is more consistent with Dario's
original approach, and it might work better. But it is also known to break
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.
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
Sorry guys, I've been my stupid self again. Indeed, I had been playing
around and had a FUN in my global environment. I've checked my history and
what I actually did, was this:
FUN <- round
myfun <- function(x, FUN, ...){
FUN(x, ...)
}
round <- 2
myfun(0.85, FUN = round, digits=1)
And then
I'm relieved to read that this issue is becoming more visible. In my own
work on optimizers, I've been finding it awkward to provide a clean
solution to allowing users to run e.g., optimx, when some optimizers are
not installed. Unfortunately, I've not found what I consider to be a
solution with
Hi Gabriel,
it actually works with: z <- .Call(stats:::C_LogLin, dtab, conf,
table, start, nmar, eps, iter).
This helps me a great deal. I will inform myself further about SEXPs.
Thank you very much,
Kai
Zitat von Gabriel Becker :
Kai,
Apologies for the double
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
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
Hi Dario,
side note: if you want to find a bug and load the updated package over and
over again
it is much easier to use use devtools::load_all()!
It directly loads the updated version
using the source package directory without the need to detach / recompile /
reinstall.
So you can e.g. do:
10 matches
Mail list logo