Displaying 20 results from an estimated 7000 matches similar to: "S4: names stripped during instantiation of grandchildren of numeric class"
2009 Aug 17
2
S4: inheritance of validity methods?
Dear Developers,
In current implementation of validity method, objects are first coerced to
superclass (slots are striped). Thus, it is not possible to write validity
method which would perform some checks on children slots.
Say, I want to check if number of slots in a class is equal to "n":
setClass("A", representation(a="numeric", n="integer"),
2009 Jun 05
1
S4: Initialization method called during setClass??
Dear UseRs,
A simple class inheritance example:
> setClass("test",representation(a="numeric"))
> setMethod("initialize","test",
function(.Object,x,...){
print("Initialization!!!")
callNextMethod(.Object,a=x,...)
})
> new("test",x=23)
[1] "Initialization!!!"
An
2009 Jun 05
2
S4: When is validObject issued? (or why S4 is killing me:( ..
Dear UseRs,
Does anyone know when exactly the validity is checked in S4? Documentation is silent:(.
Here is a small example:
setClass("test1",representation(a="numeric"))
setMethod("initialize","test1",
function(.Object,...){
a<-runif(1) ## here slot "a" is initialized ##
callNextMethod(.Object,a=a,...)
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru>
Subject: Bug in cut.POSIXt
Newsgroups: gmane.comp.lang.r.general
Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago)
Hello Everyone,
Before reporting decided to post here first:
tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class =
c("POSIXt",
2008 Dec 02
4
Bug in "transform"?
Dear useRs,
Here is a weird behavior of transform function:
mtcars1<-matcars
transform(mtcars1,t1=3,t2=4)
Error in data.frame(`_data`, e[!matched]) :
arguments imply differing number of rows: 32, 1
instead, this works:
mtcars1$t1<-0
transform(mtcars1,t1=3,t2=4)
also works if applied in turn:
transform(mtcars1,t1=3)
transform(mtcars1,t2=4)
I often need to use this
2009 Sep 11
1
Modify functions in base packages (needed for completion for proto objects)
Hello everyone,
I am trying to implement completion for proto objects. Proto extends
environment in a hierarchical way. Thus completion should list all the
names in all it's parent environments.
For "normal" classes defining names.class would do the job, but completion
for "environment" is hard coded in utils:::specialCompletions by means of
base::ls(). As result
2009 Jun 25
1
Make functions aware of theyr own slots.
Hello,
Is there a way to access function's slots from inside the function? I
want to make functions slot dependent without recurring to generic
function mechanism.
Probably this goes a bit against R philosophy, but otherwise I don't
really see the use of extending functions in R.
Would be nice to have something like:
2009 Aug 28
1
names<- in data.frame (PR#13916)
Full_Name: Spinu Vitalie
Version: 2.9.0
OS: Windows
Submission from: (NULL) (130.115.113.15)
In assignment of "zero length" names to data.frame:
> tdf <- data.frame(rbind(c(1, 2), c(1, 2)))
> names(tdf) <- c("", "")
> tdf
structure(c("1", "1"), class = "AsIs") structure(c("2", "2"), class =
2007 May 21
1
list element names in S4 class extending list
can list names attributes be preserved through S4
class containment? seems to be so but only if the containment
relationship is direct ... see below.
> setClass("c1", contains="list")
[1] "c1"
> l1 = list(a=1, b=2)
> o1 = new("c1", l1)
> names(o1) # pleasant surprise
[1] "a" "b"
> setClass("c2",
2010 Aug 15
1
parent.frame(1) of a S4 method is not a calling environment.
Dear Developers,
I wonder what are the parent.frame rules for methods. For ordinary functions one
can call parent.frame() and be sure that it is the environment of a calling
function. With S4 aparently it is not the case.
Here is what I have discovered by trial and error so far:
> setClass("A", contains="vector")
[1] "A"
> setGeneric("foo",
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
2010 Sep 23
1
strange behaviour of callNextMethod in S4 methods
Hello,
I experienced a strange behaviour of callNextMethod when used in either
initialize or any other S4 function method definition.
Help says callNextMethod calls the next inherited method for the current
function from where it is called with the same actual (non missing)
arguments. This is OK. The problem appears when some formal arguments
(in particular, S4 objects) of this function are
2007 Feb 28
1
[ win32utils-Support Requests-8957 ] Killing grandchildren?
Support Requests item #8957, was opened at 2007-02-28 13:47
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=412&aid=8957&group_id=85
Category: win32-process
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Chad Woolley (thewoolleyman)
Assigned to: Nobody (None)
Summary: Killing grandchildren?
Initial Comment:
I am trying to spawn, then
2007 May 27
0
[ win32utils-Support Requests-8957 ] Killing grandchildren?
Support Requests item #8957, was opened at 2007-02-28 13:47
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=412&aid=8957&group_id=85
Category: win32-process
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 3
Submitted By: Chad Woolley (thewoolleyman)
Assigned to: Nobody (None)
Summary: Killing grandchildren?
Initial Comment:
I am trying
2006 Jan 30
2
Finding grandchildren with has_many?
I have a table hierarchy like so:
sites->items->comments
I''d like to be able to do this in templates:
<% for comment in @site.comments.find(:all, order=>''timestamp desc'') %>
I''ve tried all the various permutations of ''has_many'' in site.rb I can
think of, but can''t get it to work. I''m not even sure if
2002 Jun 26
1
[Fwd: Kerberos buglet in OpenSSH-3.3p1]
Can anyone with Heimdal KrbV verify this?
-------------- next part --------------
An embedded message was scrubbed...
From: Dag-Erling Smorgrav <des at ofug.org>
Subject: Kerberos buglet in OpenSSH-3.3p1
Date: 25 Jun 2002 14:52:10 +0200
Size: 1291
Url: http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20020626/347e123e/attachment.mht
2005 Apr 08
2
oggzinfo buglet
Conrad,
Small buglet with the 0.9.1 liboggz release (go dude!)
http://thaumas.net/~giles/xiph/elphel/clips/elphel_00017.ogg causes a
float exception in oggzinfo when it tries to calculate the bitrate. It
fails to measure the duration and tries to divide by zero. :)
There may well be something wrong with the file, although oggz-validate
doesn't complain.
Also, the configure script
2005 Aug 18
2
Use of contains in S4 classes
setClass("B", representation=representation("B", extra="numeric))
setClass("B", representation=representation(extra="numeric"),
contains="B")
Are these the same? If not, how do they differ?
What about
setClass("B", representation=representation("B", extra="numeric"),
contains="B")
?
As far as I can
2010 Feb 02
1
S4 setClass / initialize misunderstanding
Hi, I recently ran into this problem. I couldn't find any mention of it in
the setClass documentation.
setClass("Foo", representation(file = "character"))
setMethod("initialize", "Foo", function(.Object, file) {
print(file)
})
setClass("Bar", contains = "Foo")
And the error:
Error in print(file) : argument "file" is
2012 Oct 18
1
S4 fails to initialize linear hierarchies with intermediate VIRTUAL classes
Initialization of this simple hierarchy
A = setClass("A", representation(x="numeric"))
setClass("B", contains=c("VIRTUAL", "A"))
C = setClass("C", contains="B")
fails (neat that setClass returns generators; I hadn't realized that before!)
> C(A())
Error: evaluation nested too deeply: infinite recursion /