Displaying 20 results from an estimated 3000 matches similar to: "Seeking help to define method for '+'"
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
2006 Mar 14
1
setMethod confusion
Hello I've checked through previous postings but don't see a fully
equivalent problem-just a few hints.
 
I have been trying to set a new method for the existing function "table"
or "as.data.frame.table" for my class "tfSites".
Taking out all the useful code and just returning the input class I get
the error 
 
setMethod("table",
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
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 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?
2007 Jul 18
5
Mocking Rails association collections
Rails model association collections allow you to do nifty things like:
  article.comments.find(:all, :conditions => {:created_at > 1.day.ago})
Has anyone found a good way to mock this up? I''m currently doing this:
  @comment1 = mock_model(Comment)
  comments = mock(Array)
  comments.stub!(:find).and_return([@comment1])
  @article = mock_model(Article)
 
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 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
2002 Jul 26
6
What tags are allowed in ogg files?
Hi,
I'm writing a tag-editor for ogg files.
What tags, besides ogg-tags, are allowed in ogg files (if any).
I'm thinking of id3v1, id3v2, ape tags and so on.
I have a (probably small) problem with writing a new "comment header". I
have tried opening a file with a valid header, and then simply moved some of
the comment tags position,
so that the total size and the count still
2007 Apr 24
6
Questions about table association while using acts_as_ferret
Hi all,
I''m quite new to ferret and acts_as_ferret and what to see if I can
implement the following requirement using them.
Suppose I have two model classes: Article and Comment. It''s obvious that
one article may have many comments, so this is a one-many relationship.
If I want to add full text search to these models, I''m supposed to use
acts_as_ferret in both of the
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",