Displaying 20 results from an estimated 4000 matches similar to: "binary form of is() contradicts its unary form"
2017 Nov 29
2
binary form of is() contradicts its unary form
Hi Mehmet,
On 11/29/2017 11:22 AM, Suzen, Mehmet wrote:
> Hi Herve,
>
> I think you are confusing subclasses and classes. There is no
> contradiction. `is` documentation
> is very clear:
>
> `With one argument, returns all the super-classes of this object's class.`
Yes that's indeed very clear. So if "list" is a super-class
of "data.frame" (as
2017 Nov 29
2
binary form of is() contradicts its unary form
Yes, data.frame is not an S4 class but is(data.frame())
finds its super-classes anyway and without the need to wrap
it in asS4(). And "list' is one of the super-classes. Then
is(data.frame(), "list") contradicts this.
I'm not asking for a workaround. I already have one with
'class2 %in% is(object)' as reported in my original post.
'is(asS4(object), class2)'
2017 Nov 29
0
binary form of is() contradicts its unary form
Hi Herve,
Interesting observation with `setClass` but it is for S4. It looks
like `data.frame()` is not an S4 class.
> isS4(data.frame())
[1] FALSE
And in your case this might help:
> is(asS4(data.frame()), "list")
[1] TRUE
Looks like `is` is designed for S4 classes, I am not entirely sure.
Best,
-Mehmet
On 29 November 2017 at 20:46, Herv? Pag?s <hpages at
2017 Nov 29
0
binary form of is() contradicts its unary form
Hi Herve,
I think you are confusing subclasses and classes. There is no
contradiction. `is` documentation
is very clear:
`With one argument, returns all the super-classes of this object's class.`
Note that object class is always `data.frame` here, check:
> class(data.frame())
[1] "data.frame"
> is(data.frame(), "data.frame")
[1] TRUE
Best,
Mehmet
On 29 Nov
2017 Nov 30
2
binary form of is() contradicts its unary form
2017-11-30 3:14 GMT+01:00 Suzen, Mehmet <mehmet.suzen at gmail.com>:
> My understanding is that there is no inconsistency. `is` does what it
> claims, from the documentation:
>
> ?is?: With two arguments, tests whether ?object? can be treated as
> from ?class2?.
>
> With one argument, returns all the super-classes of this
> object's
2017 Nov 30
2
binary form of is() contradicts its unary form
2017-11-30 13:26 GMT+01:00 Suzen, Mehmet <mehmet.suzen at gmail.com>:
> On 30 November 2017 at 11:37, I?aki ?car <i.ucar86 at gmail.com> wrote:
>> 2017-11-30 3:14 GMT+01:00 Suzen, Mehmet <mehmet.suzen at gmail.com>:
>>> My understanding is that there is no inconsistency. `is` does what it
>>> claims, from the documentation:
>>>
>>>
2008 Jun 05
1
is() and S3 classes
The is() function begins with the following code:
cl <- class(object)
if (length(cl) > 1) {
if (is.na(match(cl[[1]], names(getClass("oldClass")@subclasses))))
return(class2 %in% cl)
As one can see, it uses S3 inheritance if the first element of the class
attribute is an "oldClass". In R prior to 2.7, is() would check S4
inheritance if any
2017 Nov 30
3
binary form of is() contradicts its unary form
2017-11-30 14:13 GMT+01:00 Suzen, Mehmet <mehmet.suzen at gmail.com>:
> On 30 November 2017 at 14:04, I?aki ?car <i.ucar86 at gmail.com> wrote:
>>
>> Am I supposed to read every reference on a man page just to know what
>> to expect from a function?
>>
>
> If the reference is from John Chamber, you are supposed to read it.
As a joke, it's funny.
2020 Jan 21
2
class(<matrix>) |--> c("matrix", "arrary") -- and S3 dispatch
Dear Martin,
What's the ETA for _R_CLASS_MATRIX_ARRAY_=TRUE to become the new
unconditional behavior in R devel? Thanks!
H.
On 11/21/19 08:57, Martin Maechler wrote:
>
> TLDR: This is quite technical, still somewhat important:
> 1) R 4.0.0 will become a bit more coherent: a matrix is an array
> 2) Your package (or one you use) may be affected.
>
>
2020 Oct 23
2
Change to I() in R 4.1
Hi there,
Is that change in R-devel intentional?
library(Matrix)
m <- as(matrix(c(0, 1)), "sparseMatrix")
isS4(m)
# [1] TRUE
x <- I(m)
# Warning message:
# In `class<-`(x, unique.default(c("AsIs", oldClass(x)))) :
# Setting class(x) to multiple strings ("AsIs", "dgCMatrix", ...);
result will no longer be an S4 object
2016 Mar 19
2
unary class union of an S3 class
On 03/19/2016 01:22 AM, Michael Lawrence wrote:
>
>
> On Sat, Mar 19, 2016 at 12:10 AM, Herv? Pag?s <hpages at fredhutch.org
> <mailto:hpages at fredhutch.org>> wrote:
>
> On 03/18/2016 03:28 PM, Michael Lawrence wrote:
>
>
> On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s
> <hpages at fredhutch.org <mailto:hpages at
2016 Mar 19
2
unary class union of an S3 class
On 03/18/2016 03:28 PM, Michael Lawrence wrote:
>
> On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s <hpages at fredhutch.org
> <mailto:hpages at fredhutch.org>> wrote:
>
> Hi,
>
> Short story
> -----------
>
> setClassUnion("ArrayLike", "array")
>
> showClass("ArrayLike") # no slot
>
>
2016 Mar 18
2
unary class union of an S3 class
Hi,
Short story
-----------
setClassUnion("ArrayLike", "array")
showClass("ArrayLike") # no slot
setClass("MyArrayLikeConcreteSubclass",
contains="ArrayLike",
representation(stuff="ANY")
)
showClass("MyArrayLikeConcreteSubclass") # 2 slots!!
That doesn't seem right.
Long story
----------
2020 Oct 30
1
[External] Re: Change to I() in R 4.1
On Fri, 30 Oct 2020, Pages, Herve wrote:
>
> On 10/29/20 23:08, Pages, Herve wrote:
> ...
>>
>> I can think of 2 ways to move forward:
>>
>> 1. Keep I()'s current implementation but suppress the warning. We'll
>> make the necessary adjustments to DataFrame() to repair columns supplied
>> as I(<S4>) objects. Note that we would still be in
2020 Oct 30
2
Change to I() in R 4.1
Hi Martin,
On 10/26/20 04:52, Martin Maechler wrote:
>>
>> Hi there,
>> Is that change in R-devel intentional?
>>
>> library(Matrix)
>> m <- as(matrix(c(0, 1)), "sparseMatrix")
>>
>> isS4(m)
>> # [1] TRUE
>>
>> x <- I(m)
>> # Warning message:
>> # In `class<-`(x,
2015 May 13
2
Unexpected failure when calling new() with unnamed arg and
Thanks Martin for looking into this. H.
On 05/13/2015 03:57 AM, Martin Maechler wrote:
>>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>>> on Tue, 12 May 2015 15:18:42 -0700 writes:
>
>> Hi,
>
>> The man page for new() suggests that if 'a' is an object with slots
>> "slot1" and "slot2" and C is a
2017 Nov 30
1
binary form of is() contradicts its unary form
2017-11-30 15:54 GMT+01:00 Suzen, Mehmet <mehmet.suzen at gmail.com>:
>
>
> On 30 Nov 2017 14:32, "I?aki ?car" <i.ucar86 at gmail.com> wrote:
>
>>>
>>> Am I supposed to read every reference on a man page just to know what
>>> to expect from a function?
>>>
>>
>> If the reference is from John Chamber, you are supposed
2015 May 12
2
Unexpected failure when calling new() with unnamed arg and
Hi,
The man page for new() suggests that if 'a' is an object with slots
"slot1" and "slot2" and C is a class that extends the class of 'a',
then the 2 following calls should be equivalent:
new("C", a, ...)
new("C", slot1=a at slot1, slot2=a at slot2, ...)
This is generally the case but I just ran into a situation where it's
not.
2015 Oct 08
1
Unexpected failure when calling new() with unnamed arg and
>>>>> Joshua Wiley <jwiley.psych at gmail.com>
>>>>> on Thu, 8 Oct 2015 12:19:16 +1100 writes:
> Hi, I realize this is an old thread, but just wondering
> whether a conclusion was ever reached on this issue? I'm
> using formula(NULL) but it would be nice if default
> initialization worked for formula classes as well.
Well,
2020 May 22
2
paste(character(0), collapse="", recycle0=FALSE) should be ""
I agree with Herve, processing collapse happens last so collapse=non-NULL
always leads to a single character string being returned, the same as
paste(collapse=""). See the altPaste function I posted yesterday.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, May 22, 2020 at 9:12 AM Herv? Pag?s <hpages at fredhutch.org> wrote:
> I think that
>
>