similar to: Is it possible to simply the use of NULL slots (or at least improve the help files)?

Displaying 20 results from an estimated 2000 matches similar to: "Is it possible to simply the use of NULL slots (or at least improve the help files)?"

2020 Sep 24
2
Is it possible to simply the use of NULL slots (or at least improve the help files)?
Hi Martin, Thankyou for your response. I suspect that we're not going to agree on the main point. Making it trivially simple (as say Java) to set slots to NULL. So, I'll move on to the other points here. ***Note that cited text uses excerpts only.*** > setClassUnion("character_OR_NULL", c("character", "NULL")) > A = setClass("A", slots =
2020 Sep 24
0
Is it possible to simply the use of NULL slots (or at least improve the help files)?
I did ?"NULL<tab> at the command line and was lead to ?"NULL-class" and the BasicClasses help page in the methods package. getClass("NULL"), getClass("character") show that these objects are unrelated, so a class union is the way to define a class that is the union of these. The essence of the behavior you would like is
2020 Sep 24
0
Is it possible to simply the use of NULL slots (or at least improve the help files)?
Answering to convey the 'rules' as I know them, rather than to address the underlying issues that I guess you are really after... The S4 practice is to use setOldClass() to explicitly treat an S3 character() vector of classes as an assertion of linear inheritance > x <- structure (sqrt (37), class = c ("sqrt.prime", "numeric") ) > is(x,
2006 Apr 12
1
yet another problem with S4 dispatch (with setClassUnion)
Dear John and Seth, dear R-devels, once again the question of method dispatch in S4 -- this time with setClassUnion(); taking up your advice in https://stat.ethz.ch/pipermail/r-devel/2006-April/037200.html https://stat.ethz.ch/pipermail/r-devel/2006-April/037201.html I have been too quick in stating that >setClassUnion()---at least in my case---solves the problem; > The problem arises
2003 Jul 24
0
Revisions of the S4 classes software + ?Documentation
Some changes to the implementation of S4 classes in the methods package will be committed to the r-devel version, probably later today. They should be largely back-compatible (exception noted below) but they are fairly extensive, so this is an advance notice. The changes form the first of a two-stage change aimed at making the implementation more consistent with R semantics, in particular with
2006 Oct 06
1
class unions?
the code below has me confused: setClassUnion("index", c("numeric", "character", "logical")) extends("numeric") # i don't see the class union library(Matrix) extends("numeric") # now i see the class union i am aware that the "Matrix" package separately defines the "index" class union. is it the case that
2013 Mar 13
1
removing union class
Hi, I get the following error when trying to remove a union class: > setClassUnion('a', c('matrix', 'numeric')) > removeClass('a') > sessionInfo() R version 2.15.3 (2013-03-01) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8
2004 Jan 09
1
pb with install
dear all, I try to update my Rversion fro 1.7.1 to 1.8.1 on linux. I have a problem when I try to install pacakges from Bioconductors with : source("http://www.bioconductor.org/getBioC.R") and getBioC(relLevel="release") somme errors append and when I make a library(affy) for example I obtain : > library(affy) Error in setIs("character",
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 > >
2008 Nov 26
1
S4 slot containing either aov or NULL
Dear listmembers, I would like to define a class with a slot that takes either an object of class aov or NULL. I have been reading "S4 Classes in 15 pages more or less" and "Lecture: S4 classes and methods" #First I tried with list and NULL setClass(listOrNULL") setIs("list", "listOrNULL") setIs("NULL", "listOrNULL") #doesn't
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 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
I am trying to create a class union of class unions to facilitate method dispatch. When I execute code in the global environment, everything acts as expected, however when I put the same code in the context of a package, selectMethod can no longer find the correct method. This first block below puts the code in the context of a package: fn <- "codefile.R" writeLines( c(
2020 Feb 19
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
Thanks, I'll look into it. On Tue, Feb 18, 2020 at 8:32 AM Ezra Tucker <ezztucker at gmail.com> wrote: > > Hi Robert, > > This looks like a bug to me (tested in R 3.6.2 on Windows), f(new("a")) > should return "hi!". I'll add that this DOES work properly in 3.6.1 > which leads me to suspect this could be due to the subtle change in the > way
2004 Oct 14
2
setClassUnion
Hello, I have a question concerning "setClassUnion". I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000. I tried to use "setClassUnion" in a package I am currently working on. The situation is similar to the following example: The DESCRIPTION file has entries: Depends: R (>= 2.0.0), methods Imports: methods LazyLoad: yes The NAMESPACE file has
2004 Oct 14
2
setClassUnion
Hello, I have a question concerning "setClassUnion". I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000. I tried to use "setClassUnion" in a package I am currently working on. The situation is similar to the following example: The DESCRIPTION file has entries: Depends: R (>= 2.0.0), methods Imports: methods LazyLoad: yes The NAMESPACE file has
2020 Feb 26
1
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
Okay - that makes sense and thanks for looking into this! As an aside, from R-devel's perspective would you say methods are stabilizing again or do you foresee a lot of changes coming in the 4.* series? On Tue, Feb 25, 2020 at 3:39 PM Michael Lawrence via R-devel < r-devel at r-project.org> wrote: > This seems to work as expected (returning "hi!") in R-devel, but there
2020 Oct 05
2
S4 - inheritance changed by order of setClassUnion and setAs()
Dear colleagues, there is a behaviour with S4 (virtual) classes that I find very hard to understand: Depending on the position of setAs(), the tree of inheritance changes. This is my baseline example that defines the classes "grandma", "mother", "daughter" and a virtual class "mr_x". For a new instance if "daughter", "mr_x" is betweeen
2009 Feb 11
1
setClassUnion with numeric; extending class union
Dear list: I am looking for a good way to create an S4 class that would extend numeric, but would allow NULL instead of data as well. As far as I can see there is no way at the moment to do that, but please correct me if I am wrong. The best solution I came up with so far was the following (it also indicates a problem of using setClassUnion with numeric as one of the classes): I define a class
2006 Apr 07
4
setIs and method dispatch in S4 classes
Dear all, I have a question regarding setIs and method dispatch in S4 classes: Consider the following example: ##################################################### ## A02 "contains" A01 by setIs: setClass("A01", representation(a="numeric",b="numeric")) setClass("A02", representation(a="numeric",d="numeric"))