similar to: setMethod confusion

Displaying 20 results from an estimated 900 matches similar to: "setMethod confusion"

2006 Mar 15
1
setMethod confusion -best reference for S4 programming
Thanks I think you have both answered my question (reckon Ill go S3 on that). As an adjunct to this do you know what might be the best reference to the S4 methods current implementation. I have ordered the Chambers book "Programming with Data", and I have a short tutorial-- "S4 Classes in 15 pages, more or less". Have I missed any other useful resources? Stephen Henderson
2019 Jun 28
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
> On 28 Jun 2019, at 16:03 , Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>> Henrik Bengtsson >>>>>> on Thu, 27 Jun 2019 16:00:39 -0700 writes: > >> Using: >> >> untrace(methods::conformMethod) >> at <- c(12,4,3,2) >> str(body(methods::conformMethod)[[at]]) >> ## language omittedSig
2019 Jun 27
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
Using: untrace(methods::conformMethod) at <- c(12,4,3,2) str(body(methods::conformMethod)[[at]]) ## language omittedSig <- omittedSig && (signature[omittedSig] != "missing") cc <- 0L trace(methods::conformMethod, tracer = quote({ cc <<- cc + 1L print(cc) if (cc == 31) { ## manually identified untrace(methods::conformMethod)
2019 Jun 29
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
>>>>> Martin Maechler >>>>> on Sat, 29 Jun 2019 10:33:10 +0200 writes: >>>>> peter dalgaard >>>>> on Fri, 28 Jun 2019 16:20:03 +0200 writes: >> > On 28 Jun 2019, at 16:03 , Martin Maechler <maechler at stat.math.ethz.ch> wrote: >> > >> >>>>>> Henrik Bengtsson
2019 Jul 01
1
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true
I run checks with R-devel rev. 76756 on several of my packages which use S4, with no ill effects. With the risk of not adding much, it seems that Martin's example, which I repeat below, suggests a crossover between several "signatures" involved here - the signature of the generic, the signature of the method (the argument for setMethod()), and the signature of the function object
2019 Jul 04
1
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
In 'conformMethod', there is another instance of omittedSig & <something about signature[omittedSig]> . It just affects error message. Original: ? ? if(any(is.na(match(signature[omittedSig], c("ANY", "missing"))))) { ? ? ? ? bad <- omittedSig & is.na(match(signature[omittedSig], c("ANY", "missing"))) After r76756: ? ? if(any(iiN
2011 Feb 05
1
Seeking help to define method for '+'
Dear all, I am trying to define "+" method for my newly defined s4 class which is as follows: setClass("Me", sealed=F,representation(x1 = "numeric", x2 = "character")) new1 <- new("Me", x1=2, x2="comment1") new2 <- new("Me", x1=3, x2="comment1") setMethod("+", "Me",
2019 Jun 28
0
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
>>>>> Henrik Bengtsson >>>>> on Thu, 27 Jun 2019 16:00:39 -0700 writes: > Using: > > untrace(methods::conformMethod) > at <- c(12,4,3,2) > str(body(methods::conformMethod)[[at]]) > ## language omittedSig <- omittedSig && (signature[omittedSig] != "missing") > cc <- 0L > trace(methods::conformMethod, tracer =
2019 Jun 29
0
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
>>>>> peter dalgaard >>>>> on Fri, 28 Jun 2019 16:20:03 +0200 writes: > > On 28 Jun 2019, at 16:03 , Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > > >>>>>> Henrik Bengtsson > >>>>>> on Thu, 27 Jun 2019 16:00:39 -0700 writes: > > > >> Using: > >> > >>
2010 Oct 26
1
S4 methods for rbind()
Hello. I am trying to write an S4 method for rbind(). I have a class of objects called 'mdm', and I want to be able to rbind() them to one another. I do not want the method for rbind() to coerce anything to an mdm object. I want rbind(x1,x2,x1,x2) to work as expected [ie rbind() should take any number of arguments]. This is what I have so far: setGeneric(".rbind_pair",
2019 Jun 29
0
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
>>>>> Martin Maechler >>>>> on Sat, 29 Jun 2019 12:05:49 +0200 writes: >>>>> Martin Maechler >>>>> on Sat, 29 Jun 2019 10:33:10 +0200 writes: >>>>> peter dalgaard >>>>> on Fri, 28 Jun 2019 16:20:03 +0200 writes: >>> > On 28 Jun 2019, at 16:03 , Martin Maechler <maechler at
2007 Apr 26
1
Problem with R-2.5.0 patched and Matrix package
Hi, Using latest R 2.5.0 Patched, I'm unable to install the Matrix package from cran.fhcrc.org. I get: Creating a new generic function for "isSymmetric" in "Matrix" Creating a new generic function for "unname" in "Matrix" Error in conformMethod(signature, mnames, fnames, f) : In method for function "!": formal arguments omitted in
2004 Sep 22
1
S4 methods and polymorophism
Hello R Power Users, There is a rather large introduction you may skip to go directly to my question about S4 classes. I am working on some toy code to help me get in through S4 classes. Doing this homework, I have some questions about S4 classes. I have carefully read available help and some additional material such as Robert Gentleman's slides and special attention to "Programming
2019 Jun 27
2
methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
Henrik, If a minimal reprex is hard to construct, could you perhaps instrument your version of R to include a browser() call at the start of the else if(!all(signature[omittedSig] == "missing")) { branch, run the code that triggers the issue for you (and must hit that branch) and tell us what the "signature" and "omittedSig" objects look like at that point?
2009 Oct 04
3
error installing/compiling kernlab
Hi everybody, I''m using R on a 64-bit Ubuntu 9.04 (Jaunty). I prefer to install R packages from source, even if they are available in Synaptic. The problem is that I can''t install/compile kernlab. Everything works fine until it gets to the lazy loading part: ** preparing package for lazy loading Creating a new generic function for "terms" in "kernlab"
2004 May 12
1
Problem installing SparseM on Debian stable
I have troubles installing the "SparseM" package on my Debian stable Linux system. Debian's version of R is: platform i386-pc-linux-gnu arch i386 os linux-gnu system i386, linux-gnu status major 1 minor 5.1 year 2002 month 06 day 17 language R This is the installation output: > R CMD INSTALL -l /usr/lib/R/ SparseM_0.36.tar.gz * Installing
2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et seq pro tem. Next problem: how to define "Summary" methods for brobs. ?max says 'max' and 'min' are generic functions: methods can be defined for them individually or via the 'Summary' group generic. For this to work properly, the arguments '...' should be
2005 Jan 13
3
as.character methods
Hello, ?as.character says that the as.character function is a generic with usage: as.character(x, ...). So, I want to create an S4 object with an as.character method following the above usage, but I get the below error telling me that ... isn't in the generic for as.character. > setClass("tmp", "numeric") > setMethod("as.character", "tmp",
2005 Jan 13
3
as.character methods
Hello, ?as.character says that the as.character function is a generic with usage: as.character(x, ...). So, I want to create an S4 object with an as.character method following the above usage, but I get the below error telling me that ... isn't in the generic for as.character. > setClass("tmp", "numeric") > setMethod("as.character", "tmp",
2005 Nov 18
3
Method for $
Dear R experts, I have defined a class "myclass" and would like the slots to be extractable not only by "@" but also by "$". I now try to write a method for "$" that simply executes the request object at slotname, whenever someone calls object$slotname for any object of class "myclass". I don't manage to find out how I can provide this