Displaying 20 results from an estimated 2000 matches similar to: "variable names when using S3 methods"
2014 May 02
1
Authors@R: and Author field
Hi to all
Authors@R: c(person("fooa","foob", role = c("aut","cre"),
email = "fooa.foob@fooc.de"),
person("foo1","foo2", role = c("ctb"),
email = "foo1.foo2@foo3.de"))
Author: fooa foob, with contributions from foo1 foo2
using r CMD check --as-cran .. (R 3.1
2016 Feb 16
2
DllImport: How to specify the library to link to?
Hi,
I am absolutely new to LLVM. Currently reading through documentation and
the C-API (which i want to use). As i am working on Windows, i was
curios on how to specify an import which links to a function exported by
a dll. The DLLStorageClass seems to be the wy to go, this seems clear.
But after declaring a function for import, how do i specify the DLL the
function is included in?
2010 Feb 23
2
importing S4 methods using a namespace
I want to call summary on a mer object (from lme4) within my package
but I can't seem to get the namespace to import the necessary method.
I've simplified my package to this one function:
---------------------------
ss <- function(m) {
summary(m)
}
---------------------------
And my namespace file looks like this, where I've attempted to follow
the instructions in "Writing
2011 Apr 01
1
[LLVMdev] vestiges of multiple return values
Hi,
I was trying to remove some old code that handles ReturnInsts with
more than 1 operand -- see attached patch -- when I stumbled across
test/Assembler/aggregate-return-single-value.ll:
define { i32 } @fooa() nounwind {
ret i32 0
}
...
define [1 x i32] @fooc() nounwind {
ret i32 0
}
Is there really any need to handle these odd cases, where the type of
the value being returned doesn't
2017 Apr 05
0
Bug report: POSIX regular expression doesn't match for somewhat higher values of upper bound
>>>>> <dietmar.schindler at manroland-web.com>
>>>>> on Tue, 4 Apr 2017 08:45:30 +0000 writes:
> Dear Sirs,
> while
>> regexpr('(.{1,2})\\1', 'foo')
> [1] 2
> attr(,"match.length")
> [1] 2
> attr(,"useBytes")
> [1] TRUE
> yields the correct match, an
2017 Apr 04
2
Bug report: POSIX regular expression doesn't match for somewhat higher values of upper bound
Dear Sirs,
while
> regexpr('(.{1,2})\\1', 'foo')
[1] 2
attr(,"match.length")
[1] 2
attr(,"useBytes")
[1] TRUE
yields the correct match, an incremented upper bound in
> regexpr('(.{1,3})\\1', 'foo')
[1] -1
attr(,"match.length")
[1] -1
attr(,"useBytes")
[1] TRUE
incorrectly yields no match.
R versions tested:
2.11.1
2009 Mar 18
1
Why S4 methods of S3 'base' generics are not used in 'base' functions ?
Dear list,
It seems that S4 methods defined for an S3 'base' generic
are not used in 'base' functions.
This can be problematic when 'base' functions start with
something like 'as.matrix'.
### START R code
setClass("classA", contains = "matrix",
representation(realData = "numeric"))
setMethod("as.matrix",
2006 Sep 27
1
S3 methods for cbind/rbind
I created a type of object similar to a data frame. In some circumstances, It
needs special methods for "[" and "[<-" and rbind() (but not cbind()). Then I
found this in the cbind()/rbind() man page:
The method dispatching is _not_ done via 'UseMethod()', but by
C-internal dispatching. Therefore, there is no need for, e.g.,
'rbind.default'.
2012 Jan 10
1
importing S3 methods with importFrom
In my own package, I want to use the default S3 method of the generic
function lrtest() from the lmtest package. Since I need only one
function from lmtest, I tried to use importFrom in my NAMESPACE:
importFrom(lmtest, lrtest)
However, this fails R CMD check in the examples:
Error in UseMethod("lrtest") :
no applicable method for 'lrtest' applied to an object of class
2005 Nov 23
3
Infinite recursion in S3 methods crashes R on windows (related to PR#8203?)
Hi,
Infinite recursion in S3 methods seem to crash R on Windows 2000 (R
terminating with the ("Rgui.exe has generated errors...") message,
rather than throwing an error. This happens with both Rgui and Rterm.
The following toy example triggers this:
myf <- function(x, ...)
UseMethod("myf")
myf.default <- function(x, ...)
myf(x)
myf(1)
...R crashes...
Which I
2020 May 12
0
S3 method dispatch for methods in local environments
Dear Wolfgang,
I think this new behaviour is related to the following R 4.0.0 NEWS item:
> S3 method lookup now by default skips the elements of the search path between the global and base environments.
Your environment "myenv" is attached at position 2 of the search() path
and thus now skipped in S3 method lookup.
I have just noticed that
2005 Aug 03
1
deparse(substitute(x)) and S3 methods
Dear List,
I have the following function:
coca <- function(x, ...)
{
if(is.null(class(x))) class(x) <- data.class(x)
UseMethod("coca", x)
}
and a default method
coca.default <- function(x, y, method = c("predictive", "symmetric"),
reg.method = c("simpls", "eigen"), weights =
NULL,
2009 May 09
1
"Overloading" some non-dispatched S3 methods for new classes
Hello,
I am building a package that creates a new kind of object not unlike a
dataframe. However, it is not an extension of a dataframe, as the data
themselves reside elsewhere. It only contains "metadata".
I would like to be able to retrieve data from my objects such as the
number of rows, the number of columns, the colnames, etc.
I --quite naively-- thought that ncol, nrow,
2020 May 12
4
S3 method dispatch for methods in local environments
Dear All,
In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example:
myfun <- function(y) {
out <- list(y=y)
class(out) <- "myclass"
return(out)
}
print.myclass <- function(x, ...) print(formatC(x$y, format="f", digits=5))
myfun(1:4)
# prints: [1]
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation
available for a particular class, that the error message would also
report the class structure of the object dispatched on.
Example:
foo <- function(...) UseMethod("foo")
foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") }
> foo(structure(1, class="ClassA"))
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 18
3
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Scenario: An S3 method is declared for an S4 base class but called for
an instance of a derived class.
Steps to reproduce:
> Rscript -e "test <- function(x) UseMethod('test', x); test.Matrix <-
function(x) 'Hi'; MatrixDispatchTest::test(Matrix::Matrix())"
Error in UseMethod("test", x) :
no applicable method for 'test' applied to an
2006 Mar 15
1
Additional arguments in S3 method produces a warning
Hello,
I just notice this:
> x <- c(1:4,0:5, 4, 11)
> library(pastecs)
Loading required package: boot
> tp <- turnpoints(x)
> extract(tp, no.tp = FALSE, peak = TRUE, pit = FALSE)
[1] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
FALSE
Warning message:
arguments after the first two are ignored in: UseMethod("extract", e, n,
...)
>
2005 Aug 25
2
S3 class question
Hi,
I have a class called "spss" containing prepared info from an SPSS file.
>...
>class(ret) = "spss"
>return(ret)
The function that returns this defined in a file that I source into R.
Also in that file is a function matSummary.spss.
I think I ought to be able to call
>matSummary(ret)
to run the function, but only
>matSummary.spss(ret)
will work.
What
2015 Jul 23
2
Método S3 paquete
Hola,
Estoy tratando de crear un método S3 llamado "anthr" dentro del paquete
que estoy desarrollando, cuyo argumento principal es "res" que
básicamente es una lista con un solo componente. Pero si el segundo
argumento llamado "oneSize" es FALSE, "res" es una lista de listas.
Lo que he escrito hasta el momento es lo siguiente:
anthr <- function(res,
2024 Apr 20
2
passing a modified argument to an S3 method
I do not understand what your goal is here (more context may be helpful,
perhaps to others rather than me). So I doubt this is what you want, but
here is a guess -- no need to respond if it is unhelpful:
## test.default returns NULL if object "y" not found in **calling
environment and enclosures**;
## otherwise y.
test <- function(x){
UseMethod("test")
}
test.default