similar to: class unions?

Displaying 20 results from an estimated 1000 matches similar to: "class unions?"

2006 Oct 11
1
dispatching on group generics with more than one formal
please see the code below. foo2 fails to dispatch correctly, but foo does fine. i have tried 'cacheMetaData(1)' and a number of different variants of 'cacheGenericsMetaData', on the possibility there is a caching issue. but i still can't sort it out. also one general question: does it really matter what's in the body of the function definition in a
2006 Sep 27
1
potential setClass bug (with user-defined environment)
the following returns an error in an 'exists' call on my machine MyEnv <- new.env() setClass("Numeric", "numeric", where=MyEnv) franklin parlamis > version _ platform powerpc-apple-darwin8.7.0 arch powerpc os darwin8.7.0 system powerpc, darwin8.7.0 status beta major 2 minor 4.0 year
2006 Sep 23
1
generics for primitive functions
i think these two code snippets exhibit a bug. they are identical but for the inclusion of an initial line in snippet [2] [1] setMethod("Math", signature(x = "numeric"), function(x) "Works") getGeneric("sqrt")(4) [2] getGeneric("sqrt")(4) setMethod("Math", signature(x = "numeric"), function(x) "Works")
2006 Sep 20
1
residual '*tmp*' variable after "[<-" error
self-sanity check prior to filing a bug report: attempted replacement that generates an error leaves a '*tmp*' variable in the global environment. test <- 1:10 test[2:4] <- expression(e) ls() i've read section 3.4.4 of the "R Language Definition" which discusses the mechanism for replacement, and it is not clear to me whether this was intended, but i suspect
2006 Dec 18
2
write() gotcha
Hi I used write() the other day to save some results. It seems that write() does not record the full precision of the objects being written: > write(pi,file="~/f",ncolumns=1) > pi.saved <- scan("~/f") Read 1 item > dput(pi) 3.14159265358979 > dput(pi.saved) 3.141593 > pi-pi.saved [1] -3.464102e-07 > This difficulty was particularly difficult to
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 Oct 20
1
understanding virtual classes and extensions thereof
I am having some trouble creating a hierarchy of virtual classes (akin to the class structure in the 'Matrix' package). I think they arise from my not understanding the best way to specify virtual subclasses of a virtual class. please see questions below code. setClass("mom") setClass("kid1", representation("mom", "VIRTUAL"))
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
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a new class and am trying to set a method for it for S4 group generic "Summary". I have run into some signature problems. An example: > setClass("track", representation(x="numeric", y="character")) [1] "track" > setGeneric("max", group="Summary")
2019 Nov 11
2
Troubles using numeric in s4 class union
Hi all, I came across an issue in using the Matrix package which made it that I could only subset Matrices using the numeric class, but could not using integers. Steps to reproduce the problem: library(Matrix) # this class has *nothing* to do with Matrix setClass("MyClass", representation(myvalue = "numeric"), prototype(myvalue = NA_real_)) # this class also has
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 ----------
2007 Mar 19
1
Again...
Newbie trying to install wine in his Mac OSX, getting the old annoying message, home:~/Desktop/wine G3$ /Users/G3/Desktop/wine/tools/wineinstall WINE Installer v0.75 Running configure... configure: creating cache config.cache checking build system type... powerpc-apple-darwin8.7.0 checking host system type... powerpc-apple-darwin8.7.0 checking whether make sets $(MAKE)... no checking for gcc...
2006 Jul 11
1
invalid alignment error in R-2.4.0
Hi I thought I'd pass one of my package through R CMD check with R-2.4.0 with the following result (it's clean under R-2.3.1): [snip] > > # histogram of the fourth power: > hist(out^4, col="gray") *** caught bus error *** address 0x12, cause 'invalid alignment' Traceback: 1: sort(x, partial = c(half, half + 1)) 2: sum(sort(x, partial = c(half, half +
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 Sep 23
3
Is it possible to simply the use of NULL slots (or at least improve the help files)?
As far as I can tell, there's no trivial way to set arbitrary S4 slots to NULL. Most of the online examples I can find, use setClassUnion and are about 10 years old. Which, in my opinion, is defective. There's nothing "robust" about making something that should be trivially simple, really complicated. Maybe there is a simpler way, and I just haven't worked it out, yet. But
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
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
2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
Hi, I started this post on bioc-devel but this seems to be more general: https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html See reproducible example from Martin below. Thank you. Renaud ---------- Forwarded message ---------- From: Martin Morgan <mtmorgan at fhcrc.org> Date: 7 May 2013 19:55 Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem in S4
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